From d5afa35cb8a56b812267c137a5fe9a6eed8c412d Mon Sep 17 00:00:00 2001 From: Benjamin Eberlei Date: Thu, 22 Jul 2010 23:25:29 +0200 Subject: [PATCH] Added dev vs production configuration section --- manual/en/configuration.txt | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/manual/en/configuration.txt b/manual/en/configuration.txt index 39e8b625d..2a406cd9f 100644 --- a/manual/en/configuration.txt +++ b/manual/en/configuration.txt @@ -170,12 +170,14 @@ The cache implementation must implement the `Doctrine\Common\Cache\Cache` interf Usage of a metadata cache is highly recommended. -The recommended implementations are: +The recommended implementations for production are: * `Doctrine\Common\Cache\ApcCache` * `Doctrine\Common\Cache\MemcacheCache` * `Doctrine\Common\Cache\XcacheCache` +For development you should use the `Doctrine\Common\Cache\ArrayCache` which only caches data on a per-request basis. + +++ Query Cache (***RECOMMENDED***) [php] @@ -186,12 +188,14 @@ Gets or sets the cache implementation to use for caching DQL queries, that is, t Usage of a query cache is highly recommended. -The recommended implementations are: +The recommended implementations for production are: * `Doctrine\Common\Cache\ApcCache` * `Doctrine\Common\Cache\MemcacheCache` * `Doctrine\Common\Cache\XcacheCache` +For development you should use the `Doctrine\Common\Cache\ArrayCache` which only caches data on a per-request basis. + +++ SQL Logger (***Optional***) [php] @@ -208,6 +212,19 @@ Gets or sets the logger to use for logging all SQL statements executed by Doctri Gets or sets whether proxy classes should be generated automatically at runtime by Doctrine. If set to `FALSE`, proxy classes must be generated manually through the doctrine command line task `generate-proxies`. The strongly recommended value for a production environment is `FALSE`. +++ Development vs Production Configuration + +You should code your Doctrine2 bootstrapping with two different runtime models in mind. There are some serious +benefits of using APC or Memcache in production. In development however this will frequently give you fatal +errors, when you change your entities and the cache still keeps the outdated metadata. That is why we recommend +the `ArrayCache` for development. + +Furthermore you should have the Auto-generating Proxy Classes option to true in development and to false +in production. If this option is set to `TRUE` it can seriously hurt your script performance if several proxy +classes are re-generated during script execution. Filesystem calls of that magnitude can even slower than all +the database queries Doctrine issues. Additionally writing a proxy sets an exclusive file lock which can cause +serious performance bottlenecks in systems with regular concurrent requests. + ++ Connection Options The `$connectionOptions` passed as the first argument to `EntityManager::create()` has to be either an array