10000 bug #22669 [FrameworkBundle] AbstractConfigCommand: do not try regist… · symfony/symfony@0ad2f2e · GitHub
[go: up one dir, main page]

Skip to content

Commit 0ad2f2e

Browse files
committed
bug #22669 [FrameworkBundle] AbstractConfigCommand: do not try registering bundles twice (ogizanagi)
This PR was merged into the 2.7 branch. Discussion ---------- [FrameworkBundle] AbstractConfigCommand: do not try registering bundles twice | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | symfony/recipes#46 | License | MIT | Doc PR | N/A As spotted in symfony/recipes#46, there is no reason to call `registerBundles` on the kernel instance, as it's already booted. So we just have to use `getBundles` instead and `registerBundles` can be implemented in a non-rewindable way, as done with flex. Commits ------- 040edfe [FrameworkBundle] AbstractConfigCommand: do not try registering bundles twice
2 parents 2f1c28b + 040edfe commit 0ad2f2e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Bundle/FrameworkBundle/Command/AbstractConfigCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ private function initializeBundles()
9595
// Re-build bundle manually to initialize DI extensions that can be extended by other bundles in their build() method
9696
// as this method is not called when the container is loaded from the cache.
9797
$container = $this->getContainerBuilder();
98-
$bundles = $this->getContainer()->get('kernel')->registerBundles();
98+
$bundles = $this->getContainer()->get('kernel')->getBundles();
9999
foreach ($bundles as $bundle) {
100100
if ($extension = $bundle->getContainerExtension()) {
101101
$container->registerExtension($extension);

0 commit comments

Comments
 (0)
0