An easy to follow tutorial for integrating Doctrine 2 with CodeIgniter 2 is available at doctrine-project. Unfortunately, there are a few configuration problems which would prevent the proper loading of proxies if that configuration were to be used exactly as it is.
The problem is related to how the Proxies ClassLoader has been registered. PHP will attempt to load proxies which have the namespace Proxies from the directory {APPATH}/models/proxies/Proxies.
$proxiesClassLoader = new ClassLoader('Proxies', APPPATH.'models/proxies');
$proxiesClassLoader->register();
However, Doctrine has been configured to write proxies to the directory {APPATH}/models/proxies.
$config->setProxyDir(APPPATH.'/models/proxies');
$config->setProxyNamespace('Proxies');
Additionally, the suggested configuration registers a DefaultAnnotationDriver using the directory {APPPATH}/models/Entities which is unlikely to exist.
$driverImpl = $config->newDefaultAnnotationDriver(array(APPPATH.'models/Entities')); $config->setMetadataDriverImpl($driverImpl);
The configuration and instructions shown below address these issues and contain some other useful notes on the integration.
Continue reading