diff --git a/src/Symfony/Framework/Kernel.php b/src/Symfony/Framework/Kernel.php index ddc98cc331f9..406cfe44dc59 100644 --- a/src/Symfony/Framework/Kernel.php +++ b/src/Symfony/Framework/Kernel.php @@ -127,12 +127,17 @@ public function boot() $this->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') - ); + // can only be loaded once (for all Kernel in the same process) + if (!self::$loaded) { + self::$loaded = true; + + ClassCollectionLoader::load( + $this->container->getParameter('kernel.compiled_classes'), + $this->container->getParameter('kernel.cache_dir'), + 'classes', + $this->container->getParameter('kernel.debug') + ); + } foreach ($this->bundles as $bundle) { $bundle->setContainer($this->container);