diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index f1013f23c61b2..361fd9c10b73b 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -479,15 +479,21 @@ protected function initializeContainer() $class = $this->getContainerClass(); $cache = new ConfigCache($this->getCacheDir().'/'.$class.'.php', $this->debug); $fresh = true; + for ($classVersion = 0; class_exists($class . ($classVersion ?: '')); $classVersion++); if (!$cache->isFresh()) { $container = $this->buildContainer(); $container->compile(); + $class .= $classVersion ?: ''; $this->dumpContainer($cache, $container, $class, $this->getContainerBaseClass()); $fresh = false; + } else { + $class .= $classVersion ? $classVersion - 1 : ''; } - require_once $cache->getPath(); + if(!in_array($class, get_declared_classes())) { + require $cache->getPath(); + } $this->container = new $class(); $this->container->set('kernel', $this);
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: