diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/ContainerBuilderDebugDumpPass.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/ContainerBuilderDebugDumpPass.php index 5dadcc0790..1ad45fc5f8 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/ContainerBuilderDebugDumpPass.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/ContainerBuilderDebugDumpPass.php @@ -41,10 +41,8 @@ class ContainerBuilderDebugDumpPass implements CompilerPassInterface */ static public function getBuilderCacheFilename(ContainerInterface $container) { - $name = $container->getParameter('kernel.name'); - $env = ucfirst($container->getParameter('kernel.environment')); - $debug = $container->getParameter('kernel.debug') ? 'Debug' : ''; + $class = $container->getParameter('kernel.container_class'); - return $container->getParameter('kernel.cache_dir').'/'.$name.$env.$debug.'ProjectContainerBuilder.cache'; + return $container->getParameter('kernel.cache_dir').'/'.$class.'Builder.cache'; } } diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index dfd32c1ca4..46059481ce 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -397,9 +397,19 @@ abstract class Kernel implements KernelInterface } + /** + * Gets the container class. + * + * @return string The container class + */ + protected function getContainerClass() + { + return $this->name.ucfirst($this->environment).($this->debug ? 'Debug' : '').'ProjectContainer'; + } + protected function initializeContainer() { - $class = $this->name.ucfirst($this->environment).($this->debug ? 'Debug' : '').'ProjectContainer'; + $class = $this->getContainerClass(); $cache = new ConfigCache($this->getCacheDir().'/'.$class.'.php', $this->debug); $fresh = false; if (!$cache->isFresh()) { @@ -428,14 +438,15 @@ abstract class Kernel implements KernelInterface return array_merge( array( - 'kernel.root_dir' => $this->rootDir, - 'kernel.environment' => $this->environment, - 'kernel.debug' => $this->debug, - 'kernel.name' => $this->name, - 'kernel.cache_dir' => $this->getCacheDir(), - 'kernel.logs_dir' => $this->getLogDir(), - 'kernel.bundles' => $bundles, - 'kernel.charset' => 'UTF-8', + 'kernel.root_dir' => $this->rootDir, + 'kernel.environment' => $this->environment, + 'kernel.debug' => $this->debug, + 'kernel.name' => $this->name, + 'kernel.cache_dir' => $this->getCacheDir(), + 'kernel.logs_dir' => $this->getLogDir(), + 'kernel.bundles' => $bundles, + 'kernel.charset' => 'UTF-8', + 'kernel.container_class' => $this->getContainerClass(), ), $this->getEnvParameters() );