瀏覽代碼

Made namespace for Doctrine cache unique to each environment

Solves issues with the cache not being valid for the DBAL ACL provider using D2 as the cache and switching environments.

An exception has been thrown during the rendering of a template ("Warning: Illegal offset type in isset or empty in ../vendor/symfony/src/Symfony/Component/Security/Acl/Dbal/AclProvider.php line 404")
Geoffrey Tran 14 年之前
父節點
當前提交
91cfb24e40
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/Symfony/Bundle/DoctrineBundle/DependencyInjection/DoctrineExtension.php

+ 1 - 1
src/Symfony/Bundle/DoctrineBundle/DependencyInjection/DoctrineExtension.php

@@ -389,7 +389,7 @@ class DoctrineExtension extends AbstractDoctrineExtension
 
         $cacheDef->setPublic(false);
         // generate a unique namespace for the given application
-        $namespace = 'sf2orm_'.$entityManager['name'].'_'.md5($container->getParameter('kernel.root_dir'));
+        $namespace = 'sf2orm_'.$entityManager['name'].'_'.md5($container->getParameter('kernel.root_dir').$container->getParameter('kernel.environment'));
         $cacheDef->addMethodCall('setNamespace', array($namespace));
 
         return $cacheDef;