Kaynağa Gözat

[DoctrineBundle] made sure that the Doctine cache is not shared between different applications

Fabien Potencier 14 yıl önce
ebeveyn
işleme
3bf67367c0

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

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