8000 [DoctrineBridge] [ORM] Use custom cache namespace option if it is spe… · daifma/symfony@e6687d9 · GitHub
[go: up one dir, main page]

Skip to content

Commit e6687d9

Browse files
Tatshfabpot
authored andcommitted
[DoctrineBridge] [ORM] Use custom cache namespace option if it is specified
1 parent 46efc9b commit e6687d9

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -362,9 +362,13 @@ protected function loadObjectManagerCacheDriver(array $objectManager, ContainerB
362362
}
363363

364364
$cacheDef->setPublic(false);
365-
// generate a unique names 844C pace for the given application
366-
$namespace = 'sf2'.$this->getMappingResourceExtension().'_'.$objectManager['name'].'_'.md5($container->getParameter('kernel.root_dir').$container->getParameter('kernel.environment'));
367-
$cacheDef->addMethodCall('setNamespace', array($namespace));
365+
366+
if (!isset($cacheDriver['namespace'])) {
367+
// generate a unique namespace for the given application
368+
$cacheDriver['namespace'] = 'sf2'.$this->getMappingResourceExtension().'_'.$objectManager['name'].'_'.md5($container->getParameter('kernel.root_dir').$container->getParameter('kernel.environment'));
369+
}
370+
371+
$cacheDef->addMethodCall('setNamespace', array($cacheDriver['namespace']));
368372

369373
$container->setDefinition($cacheDriverService, $cacheDef);
370374
}

0 commit comments

Comments
 (0)
0