1
0
Fork 0
mirror of synced 2025-04-03 13:23:37 +03:00
This commit is contained in:
Osman Üngür 2012-04-02 12:11:38 +03:00
parent 4fc7389b1d
commit e69b022472

View file

@ -165,9 +165,9 @@ class Setup
$proxyDir = $proxyDir ?: sys_get_temp_dir(); $proxyDir = $proxyDir ?: sys_get_temp_dir();
if ($isDevMode === false && $cache === null) { if ($isDevMode === false && $cache === null) {
if (extension_loaded('apc')) { if (extension_loaded('apc')) {
$cache = new \Doctrine\Common\Cache\ApcCache; $cache = new \Doctrine\Common\Cache\ApcCache();
} else if (extension_loaded('xcache')) { } else if (extension_loaded('xcache')) {
$cache = new \Doctrine\Common\Cache\XcacheCache; $cache = new \Doctrine\Common\Cache\XcacheCache();
} else if (extension_loaded('memcache')) { } else if (extension_loaded('memcache')) {
$memcache = new \Memcache(); $memcache = new \Memcache();
$memcache->connect('127.0.0.1'); $memcache->connect('127.0.0.1');
@ -179,10 +179,10 @@ class Setup
$cache = new \Doctrine\Common\Cache\RedisCache(); $cache = new \Doctrine\Common\Cache\RedisCache();
$cache->setRedis($redis); $cache->setRedis($redis);
} else { } else {
$cache = new ArrayCache; $cache = new ArrayCache();
} }
} else if ($cache === null) { } else if ($cache === null) {
$cache = new ArrayCache; $cache = new ArrayCache();
} }
$cache->setNamespace("dc2_" . md5($proxyDir) . "_"); // to avoid collisions $cache->setNamespace("dc2_" . md5($proxyDir) . "_"); // to avoid collisions
@ -190,7 +190,7 @@ class Setup
$config->setMetadataCacheImpl($cache); $config->setMetadataCacheImpl($cache);
$config->setQueryCacheImpl($cache); $config->setQueryCacheImpl($cache);
$config->setResultCacheImpl($cache); $config->setResultCacheImpl($cache);
$config->setProxyDir( $proxyDir ); $config->setProxyDir($proxyDir);
$config->setProxyNamespace('DoctrineProxies'); $config->setProxyNamespace('DoctrineProxies');
$config->setAutoGenerateProxyClasses($isDevMode); $config->setAutoGenerateProxyClasses($isDevMode);