Take the 2-minute tour ×

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');

And it works. So it seems it has something to do with Zend Framework?

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

well the "Doctrine" only autoloader probably already matches for the DoctrineExtensions classes. You have to reorder them accordingly.

share|improve this answer
thanks that does the trick. thats abit weird that DoctrineExtensions can get mixed up with Doctrine They start with the same thing but they are different words. I was expecting them to match Doctrine\xxx and DoctrineExtensions\xxx –  Jiew Meng Dec 22 '10 at 9:51
add comment

Your Answer


