Skip to content

Commit

Permalink
handle inheritance in config:dump-reference when a bundle name is pas…
Browse files Browse the repository at this point in the history
…sed to the command
  • Loading branch information
lsmith77 committed Jul 31, 2012
1 parent de958c7 commit cdfbe72
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ protected function configure()
protected function execute(InputInterface $input, OutputInterface $output)
{
$this->output = $output;
$kernel = $this->getContainer()->get('kernel');
$bundles = $this->getContainer()->get('kernel')->getBundles();
$containerBuilder = $this->getContainerBuilder();

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

if (preg_match('/Bundle$/', $name)) {
// input is bundle name
$extension = $kernel->getBundle($name)->getContainerExtension();

if (isset($bundles[$name])) {
$extension = $bundles[$name]->getContainerExtension();
}

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

$message = 'Default configuration for "'.$name.'"';
} else {
foreach ($kernel->getBundles() as $bundle) {
foreach ($bundles as $bundle) {
$extension = $bundle->getContainerExtension();

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

0 comments on commit cdfbe72

Please sign in to comment.