Oddities when mixing Zend Framework 1.11 & Doctrine 2 Autoloaders
- by jiewmeng
I have setup autoloading in my ZF/Doctrine2 app as follows
$zendAutoloader = Zend_Loader_Autoloader::getInstance();
$autoloader = array(new ClassLoader('Symfony'), 'loadClass');
$zendAutoloader->pushAutoloader($autoloader, 'Symfony');
$autoloader = array(new ClassLoader('Doctrine'), 'loadClass');
$zendAutoloader->pushAutoloader($autoloader, 'Doctrine');
$autoloader = array(new ClassLoader('Application', realpath(__DIR__ . '/..')), 'loadClass');
$zendAutoloader->pushAutoloader($autoloader, 'Application');
$autoloader = array(new ClassLoader('DoctrineExtensions'), 'loadClass');
$zendAutoloader->pushAutoloader($autoloader, 'DoctrineExtensions');
I find that the DoctrineExtensions autoloading is not working while other classes are ... to verify that the path etc are right, I tried
$autoloader = new ClassLoader('DoctrineExtensions');
$autoloader->register();
And it works. So it seems it has something to do with Zend Framework?