I’m currently integrating non symfony2 software (let’s call it nsf) in an sf2 project. That software uses __autoload.
When trying to access some nsf features in a twig extension, I get fatal errors about classes not found. It appears that when called from symfony2 code, the __autoload function is not called at all.
I recently moved to php5 so this might sound like a newbie question but I’m trying to figure out what’s going on.
Thanks for your clues.
This sounds like a problem originating in the usage of
__autoload. If you can, replace those calls with the ‘new’spl_autoload_register()call currently adviced:see: http://php.net/manual/en/language.oop5.autoload.php
__autoload()is only one function, and is prone to overriding if 2 files want to do something with that. Usingspl_autoload_register()means you can register several autoload functions.