From 974e31a3071136bacfc4f80e579168291768f951 Mon Sep 17 00:00:00 2001 From: Benjamin Eberlei Date: Thu, 22 Jul 2010 23:29:21 +0200 Subject: [PATCH] Use $applicationMode flag in obtaining entity manager example to make sure people understand that different settings for production and development are necessary --- manual/en/configuration.txt | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/manual/en/configuration.txt b/manual/en/configuration.txt index 2a406cd9f..a76e09db5 100644 --- a/manual/en/configuration.txt +++ b/manual/en/configuration.txt @@ -84,15 +84,27 @@ with the following minimalist configuration: Doctrine\ORM\Configuration; // ... - + + if ($applicationMode == "development") { + $cache = new \Doctrine\Common\Cache\ArrayCache; + } else { + $cache = new \Doctrine\Common\Cache\ApcCache; + } + $config = new Configuration; - $cache = new \Doctrine\Common\Cache\ApcCache; $config->setMetadataCacheImpl($cache); $driverImpl = $config->newDefaultAnnotationDriver('/path/to/lib/MyProject/Entities'); $config->setMetadataDriverImpl($driverImpl); $config->setQueryCacheImpl($cache); $config->setProxyDir('/path/to/myproject/lib/MyProject/Proxies'); $config->setProxyNamespace('MyProject\Proxies'); + + if ($applicationMode == "development") { + $config->setAutoGenerateProxyClasses(true); + } else { + $config->setAutoGenerateProxyClasses(true); + } + $connectionOptions = array( 'driver' => 'pdo_sqlite', 'path' => 'database.sqlite'