We are porting a Contao 4.3 installation to 4.13 and a part of it is already in a bundle.
In our Controller in the bundle we have code like this:
use foo_events\Foo_Payment;
class ApplicationController
public function notifypaypalAction()
{
$arrConfig = Foo_Payment::getConfig('paypal');
}
Now the Foo_Payment class cannot be found. It is in the module autoload.php but it seems like in the bundle Contao is not properly initialized.
Can we still load old modules in a bundle or do we have to port everything to the bundle?
I already tried to
require_once '../../../system/modules/foo_events/classes/Foo_Payment.php';
This solves the Problem with finding Foo_Payment, but the code
return $GLOBALS['TL_CONFIG']['fooevents']['giropay'][$strConfigType][$strEnv];
now crashes with
Warning: Undefined global variable $TL_CONFIG
while I would expect TL_CONFIG to be always accessible.
implements \Symfony\Component\DependencyInjection\ContainerAwareInterface