[FrameworkBundle] AbstractConfigCommand: do not try registering bundles twice

This commit is contained in:
Maxime Steinhausser 2017-05-08 10:50:08 +02:00
parent 62cb443770
commit 040edfec4a

View File

@ -95,7 +95,7 @@ abstract class AbstractConfigCommand extends ContainerDebugCommand
// Re-build bundle manually to initialize DI extensions that can be extended by other bundles in their build() method // Re-build bundle manually to initialize DI extensions that can be extended by other bundles in their build() method
// as this method is not called when the container is loaded from the cache. // as this method is not called when the container is loaded from the cache.
$container = $this->getContainerBuilder(); $container = $this->getContainerBuilder();
$bundles = $this->getContainer()->get('kernel')->registerBundles(); $bundles = $this->getContainer()->get('kernel')->getBundles();
foreach ($bundles as $bundle) { foreach ($bundles as $bundle) {
if ($extension = $bundle->getContainerExtension()) { if ($extension = $bundle->getContainerExtension()) {
$container->registerExtension($extension); $container->registerExtension($extension);