Navigation Menu

Skip to content

Commit

Permalink
Only call registerCommand on bundles that is an instance of Bundle
Browse files Browse the repository at this point in the history
Fixes GH-5133
  • Loading branch information
henrikbjorn committed Aug 1, 2012
1 parent 1da896d commit 0b78fdf
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Symfony/Bundle/FrameworkBundle/Console/Application.php
Expand Up @@ -17,6 +17,7 @@
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\HttpKernel\KernelInterface;
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\HttpKernel\Bundle;

/**
* Application.
Expand Down Expand Up @@ -78,8 +79,11 @@ public function doRun(InputInterface $input, OutputInterface $output)
protected function registerCommands()
{
$this->kernel->boot();

foreach ($this->kernel->getBundles() as $bundle) {
$bundle->registerCommands($this);
if ($bundle instanceof Bundle) {
$bundle->registerCommands($this);
}
}
}
}

2 comments on commit 0b78fdf

@Burgov
Copy link
Contributor

@Burgov Burgov commented on 0b78fdf Aug 3, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

has this been tested at all? All my commands have disappeared...

the use statement should read "use Symfony\Component\HttpKernel\Bundle\Bundle;"

@magnusnordlander
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this commit is a dud.

Please sign in to comment.