8000 merged branch lsmith77/bundle_inheritance_in_config_dump_reference (P… · symfony/symfony@842b599 · GitHub
[go: up one dir, main page]

Skip to content

Commit 842b599

Browse files
committed
merged branch lsmith77/bundle_inheritance_in_config_dump_reference (PR #5126)
Commits ------- cdfbe72 handle inheritance in config:dump-reference when a bundle name is passed to the command Discussion ---------- handle inheritance in config:dump-reference Bug fix: yes Feature addition: no Backwards compatibility break: no Symfony2 tests pass: ? Fixes the following tickets: - License of the code: MIT Currently when passing in a bundle name that identifies a bundle that is a parent to another bundle, it will not return the reference for the requested bundle, but for the inheriting (even if that bundle has no configuration class). F.e. app/console config:dump-reference SymfonyCmfBlockBundle will fail if there is a Bundle SandboxBlockBundle that has SymfonyCmfBlockBundle set as the parent.
2 parents 0ccda38 + cdfbe72 commit 842b599

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ protected function configure()
6262
protected function execute(InputInterface $input, OutputInterface $output)
6363
{
6464
$this->output = $output;
65-
$kernel = $this->getContainer()->get('kernel');
65+
$bundles = $this->getContainer()->get('kernel')->getBundles();
6666
$containerBuilder = $this->getContainerBuilder();
6767

6868
$name = $input->getArgument('name');
@@ -71,15 +71,18 @@ protected function execute(InputInterface $input, OutputInterface $output)
7171

7272
if (preg_match('/Bundle$/', $name)) {
7373
// input is bundle name
74-
$extension = $kernel->getBundle($name)->getContainerExtension();
74+
75+
if (isset($bundles[$name])) {
76+
$extension = $bundles[$name]->getContainerExtension();
77+
}
7578

7679
if (!$extension) {
7780
throw new \LogicException('No extensions with configuration available for "'.$name.'"');
7881
}
7982

8083
$message = 'Default configuration for "'.$name.'"';
8184
} else {
82-
foreach ($kernel->getBundles() as $bundle) {
85+
foreach ($bundles as $bundle) {
8386
$extension = $bundle->getContainerExtension();
8487

8588
if ($extension && $extension->getAlias() === $name) {

0 commit comments

Comments
 (0)
0