Sfoglia il codice sorgente

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 anni fa
parent
commit
91cfb24e40

+ 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;