Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5807f5f

Browse files
committed
bug #34755 [FrameworkBundle] resolve service locators in debug:* commands (nicolas-grekas)
This PR was merged into the 3.4 branch. Discussion ---------- [FrameworkBundle] resolve service locators in `debug:*` commands | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #34470 | License | MIT | Doc PR | - Because of the way ServiceClosureArgument are dumped, we need to resolve locators after loading the xml dump of the container: https://github.com/symfony/symfony/blob/3.4/src/Symfony/Component/DependencyInjection/Dumper/XmlDumper.php#L273 Commits ------- 820da66 [FrameworkBundle] resolve service locators in `debug:*` commands
2 parents ffcb691 + 820da66 commit 5807f5f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
use Symfony\Component\Console\Input\InputOption;
2121
use Symfony\Component\Console\Output\OutputInterface;
2222
use Symfony\Component\Console\Style\SymfonyStyle;
23+
use Symfony\Component\DependencyInjection\Compiler\ServiceLocatorTagPass;
2324
use Symfony\Component\DependencyInjection\ContainerBuilder;
2425
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
2526
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
@@ -198,6 +199,8 @@ protected function getContainerBuilder()
198199
$container->compile();
199200
} else {
200201
(new XmlFileLoader($container = new ContainerBuilder(), new FileLocator()))->load($kernel->getContainer()->getParameter('debug.container.dump'));
202+
$locatorPass = new ServiceLocatorTagPass();
203+
$locatorPass->process($container);
201204
}
202205

203206
return $this->containerBuilder = $container;

0 commit comments

Comments
 (0)