ソースを参照

moved class compiled in cache to the FrameworkBundle

Fabien Potencier 14 年 前
コミット
db818284af

+ 10 - 0
src/Symfony/Bundle/FrameworkBundle/FrameworkBundle.php

@@ -25,6 +25,7 @@ use Symfony\Component\DependencyInjection\ContainerBuilder;
 use Symfony\Component\DependencyInjection\Compiler\PassConfig;
 use Symfony\Component\HttpFoundation\File\File;
 use Symfony\Component\HttpKernel\Bundle\Bundle;
+use Symfony\Component\HttpKernel\ClassCollectionLoader;
 
 /**
  * Bundle.
@@ -47,6 +48,15 @@ class FrameworkBundle extends Bundle
         if ($this->container->hasParameter('document_root')) {
             File::setDocumentRoot($this->container->getParameter('document_root'));
         }
+
+        // load core classes
+        ClassCollectionLoader::load(
+            $this->container->getParameter('kernel.compiled_classes'),
+            $this->container->getParameter('kernel.cache_dir'),
+            'classes',
+            $this->container->getParameter('kernel.debug'),
+            true
+        );
     }
 
     public function registerExtensions(ContainerBuilder $container)

+ 0 - 20
src/Symfony/Bundle/FrameworkBundle/Tests/Kernel.php

@@ -67,24 +67,4 @@ class Kernel extends BaseKernel
             $container->setParameter('kernel.compiled_classes', array());
         });
     }
-
-    public function boot()
-    {
-        if (true === $this->booted) {
-            throw new \LogicException('The kernel is already booted.');
-        }
-
-        // init bundles
-        $this->initializeBundles();
-
-        // init container
-        $this->initializeContainer();
-
-        foreach ($this->bundles as $bundle) {
-            $bundle->setContainer($this->container);
-            $bundle->boot();
-        }
-
-        $this->booted = true;
-    }
 }

+ 0 - 10
src/Symfony/Component/HttpKernel/Kernel.php

@@ -25,7 +25,6 @@ use Symfony\Component\DependencyInjection\Loader\PhpFileLoader;
 use Symfony\Component\DependencyInjection\Loader\ClosureLoader;
 use Symfony\Component\HttpFoundation\Request;
 use Symfony\Component\HttpKernel\HttpKernelInterface;
-use Symfony\Component\HttpKernel\ClassCollectionLoader;
 use Symfony\Component\HttpKernel\Bundle\BundleInterface;
 
 /**
@@ -103,15 +102,6 @@ abstract class Kernel implements KernelInterface
         // init container
         $this->initializeContainer();
 
-        // load core classes
-        ClassCollectionLoader::load(
-            $this->container->getParameter('kernel.compiled_classes'),
-            $this->container->getParameter('kernel.cache_dir'),
-            'classes',
-            $this->container->getParameter('kernel.debug'),
-            true
-        );
-
         foreach ($this->bundles as $bundle) {
             $bundle->setContainer($this->container);
             $bundle->boot();

+ 0 - 8
src/Symfony/Component/HttpKernel/bootstrap.php

@@ -660,7 +660,6 @@ use Symfony\Component\DependencyInjection\Loader\PhpFileLoader;
 use Symfony\Component\DependencyInjection\Loader\ClosureLoader;
 use Symfony\Component\HttpFoundation\Request;
 use Symfony\Component\HttpKernel\HttpKernelInterface;
-use Symfony\Component\HttpKernel\ClassCollectionLoader;
 use Symfony\Component\HttpKernel\Bundle\BundleInterface;
 abstract class Kernel implements KernelInterface
 {
@@ -704,13 +703,6 @@ abstract class Kernel implements KernelInterface
         }
                 $this->initializeBundles();
                 $this->initializeContainer();
-                ClassCollectionLoader::load(
-            $this->container->getParameter('kernel.compiled_classes'),
-            $this->container->getParameter('kernel.cache_dir'),
-            'classes',
-            $this->container->getParameter('kernel.debug'),
-            true
-        );
         foreach ($this->bundles as $bundle) {
             $bundle->setContainer($this->container);
             $bundle->boot();