Zend Framework 2 How to Install Doctrine 2 Proxy Directory

So, I use the Doctrine 2 module in Zend Framework 2, configured according to the Turkish website of Jason Grimes (http://www.jasongrimes.org/2012/01/using-doctrine-2-in-zend-framework-2/) .

Sometimes I keep getting this error:

Your proxy directory must be writable. 

How to set proxy server directory?

Here is my Doctrine configuration from module.config.php:

 'doctrine' => array( 'driver' => array( __NAMESPACE__ . '_driver' => array( 'class' => 'Doctrine\ORM\Mapping\Driver\AnnotationDriver', 'cache' => 'array', 'paths' => array(__DIR__ . '/../src/' . __NAMESPACE__ . '/Entity') ), 'orm_default' => array( 'drivers' => array( __NAMESPACE__ . '\Entity' => __NAMESPACE__ . '_driver' ), ), ), ), 
+7
source share
1 answer

The default proxy directory is data/DoctrineORMModule/Proxy . You probably know how to make it writable, right?

If for some reason you need to change it, you can overwrite the corresponding configuration key:

 <?php return array( 'doctrine' => array( 'configuration' => array( '<YOUR DRIVER NAME (orm_default by default)>' => array( 'proxy_dir' => 'data/DoctrineORMModule/Proxy', 'proxy_namespace' => 'DoctrineORMModule\Proxy', ) ) ) ); ?> 

Hope this helps.

+20
source

All Articles