Ver código fonte

method buildContainer divided into logical parts

Martin Hason 14 anos atrás
pai
commit
08c3a2b40b
1 arquivos alterados com 7 adições e 2 exclusões
  1. 7 2
      src/Symfony/Component/HttpKernel/Kernel.php

+ 7 - 2
src/Symfony/Component/HttpKernel/Kernel.php

@@ -297,7 +297,8 @@ abstract class Kernel implements HttpKernelInterface, \Serializable
         $reload = $this->debug ? $this->needsReload($class, $location) : false;
 
         if ($reload || !file_exists($location.'.php')) {
-            $this->buildContainer($class, $location.'.php');
+            $container = $this->buildContainer();
+            $this->dumpContainer($container, $class, $location.'.php');
         }
 
         require_once $location.'.php';
@@ -360,7 +361,7 @@ abstract class Kernel implements HttpKernelInterface, \Serializable
         return false;
     }
 
-    protected function buildContainer($class, $file)
+    protected function buildContainer()
     {
         $parameterBag = new ParameterBag($this->getKernelParameters());
 
@@ -377,7 +378,11 @@ abstract class Kernel implements HttpKernelInterface, \Serializable
             $container->merge($cont);
         }
         $container->freeze();
+        return $container;
+    }
 
+    protected function dumpContainer(ContainerBuilder $container, $class, $file)
+    {
         foreach (array('cache', 'logs') as $name) {
             $dir = $container->getParameter(sprintf('kernel.%s_dir', $name));
             if (!is_dir($dir)) {