diff --git a/src/Symfony/Component/DependencyInjection/Compiler/MergeExtensionConfigurationPass.php b/src/Symfony/Component/DependencyInjection/Compiler/MergeExtensionConfigurationPass.php index f9e6024164c15..1fa43323e7467 100644 --- a/src/Symfony/Component/DependencyInjection/Compiler/MergeExtensionConfigurationPass.php +++ b/src/Symfony/Component/DependencyInjection/Compiler/MergeExtensionConfigurationPass.php @@ -47,6 +47,9 @@ public function process(ContainerBuilder $container) $tmpContainer = new ContainerBuilder($container->getParameterBag()); $tmpContainer->setResourceTracking($container->isTrackingResources()); $tmpContainer->addObjectResource($extension); + if ($container->has('kernel.bundles')) { + $tmpContainer->set('kernel.bundles', $container->get('kernel.bundles')); + } foreach ($exprLangProviders as $provider) { $tmpContainer->addExpressionLanguageProvider($provider); diff --git a/src/Symfony/Component/HttpKernel/Bundle/BundleMetadata.php b/src/Symfony/Component/HttpKernel/Bundle/BundleMetadata.php new file mode 100644 index 0000000000000..50598d3479f62 --- /dev/null +++ b/src/Symfony/Component/HttpKernel/Bundle/BundleMetadata.php @@ -0,0 +1,103 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\Bundle; + +/** + * Value object representing bundle metadata. + * + * @author Roland Franssen + */ +final class BundleMetadata +{ + private $name; + private $namespace; + private $className; + private $path; + private $parent; + + /** + * Constructor. + * + * @param string $name + * @param string $namespace + * @param string $className + * @param string $path + * @param BundleMetadata|null $parent + */ + public function __construct($name, $namespace, $className, $path, BundleMetadata $parent = null) + { + $this->name = $name; + $this->className = $className; + $this->path = $path; + $this->parent = $parent; + } + + /** + * Get bundle name. + * + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Get bundle namespace. + * + * @return string + */ + public function getNamespace() + { + return $this->namespace; + } + + /** + * Get bundle class name. + * + * @return string + */ + public function getClassName() + { + return $this->className; + } + + /** + * Get bundle path. + * + * @return string + */ + public function getPath() + { + return $this->path; + } + + /** + * Get parent bundle, if any. + * + * @return BundleMetadata|null + */ + public function getParent() + { + return $this->parent; + } + + /** + * Get string representation. + * + * @return string + */ + public function __toString() + { + return $this->className; + } +} diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index 125da81d5ca4d..793f8ce9c7a2e 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -26,6 +26,7 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Bundle\BundleInterface; +use Symfony\Component\HttpKernel\Bundle\BundleMetadata; use Symfony\Component\HttpKernel\Config\EnvParametersResource; use Symfony\Component\HttpKernel\Config\FileLocator; use Symfony\Component\HttpKernel\DependencyInjection\MergeExtensionConfigurationPass; @@ -585,6 +586,23 @@ protected function buildContainer() */ protected function prepareContainer(ContainerBuilder $container) { + $bundleMetadata = array(); + $numBundles = count($this->bundles); + $numProcessedBundles = 0; + do { + foreach ($this->bundles as $name => $bundle) { + $parent = $bundle->getParent(); + if (null !== $parent && !isset($bundleMetadata[$parent])) { + continue; + } + if (!isset($bundleMetadata[$name])) { + $bundleMetadata[$name] = new BundleMetadata($name, $bundle->getNamespace(), get_class($bundle), $bundle->getPath(), isset($bundleMetadata[$parent]) ? $bundleMetadata[$parent] : null); + ++$numProcessedBundles; + } + } + } while ($numProcessedBundles < $numBundles); + $container->set('kernel.bundles', new \ArrayIterator($bundleMetadata)); + $extensions = array(); foreach ($this->bundles as $bundle) { if ($extension = $bundle->getContainerExtension()) { pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

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:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy