瀏覽代碼

[Foundation] added the env and debug information in the project container class name to avoid potential clashes if you manipulate several container in the same PHP script

Fabien Potencier 15 年之前
父節點
當前提交
abe86d2608
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/Symfony/Foundation/Kernel.php

+ 1 - 1
src/Symfony/Foundation/Kernel.php

@@ -254,7 +254,7 @@ abstract class Kernel implements HttpKernelInterface, \Serializable
 
     protected function initializeContainer()
     {
-        $class = $this->name.'ProjectContainer';
+        $class = $this->name.ucfirst($this->environment).($this->debug ? 'Debug' : '').'ProjectContainer';
         $location = $this->getCacheDir().'/'.$class;
         $reload = $this->debug ? $this->needsReload($class, $location) : false;