Skip to content

Commit

Permalink
do not re-register commands each time a Console\Application is run
Browse files Browse the repository at this point in the history
  • Loading branch information
tomdmaguire authored and fabpot committed Jun 13, 2013
1 parent 0991cd0 commit 842f3fa
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Symfony/Bundle/FrameworkBundle/Console/Application.php
Expand Up @@ -27,6 +27,7 @@
class Application extends BaseApplication
{
private $kernel;
private $commandsRegistered = false;

/**
* Constructor.
Expand Down Expand Up @@ -65,7 +66,9 @@ public function getKernel()
*/
public function doRun(InputInterface $input, OutputInterface $output)
{
$this->registerCommands();
if (!$this->commandsRegistered) {
$this->registerCommands();
}

if (true === $input->hasParameterOption(array('--shell', '-s'))) {
$shell = new Shell($this);
Expand All @@ -87,5 +90,7 @@ protected function registerCommands()
$bundle->registerCommands($this);
}
}

$this->commandsRegistered = true;
}
}

0 comments on commit 842f3fa

Please sign in to comment.