diff --git a/src/Symfony/Bundle/FrameworkBundle/Console/Application.php b/src/Symfony/Bundle/FrameworkBundle/Console/Application.php index 06a8698cf162f..97219c76283ab 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Console/Application.php +++ b/src/Symfony/Bundle/FrameworkBundle/Console/Application.php @@ -27,6 +27,7 @@ class Application extends BaseApplication { private $kernel; + private $commandsRegistered = false; /** * Constructor. @@ -65,7 +66,9 @@ public function getKernel() */ public function doRun(InputInterface $input, OutputInterface $output) { - $this->registerCommands(); + if (!$this->commandsRegistered) { + $this->registerCommands(); + } $this->setDispatcher($this->kernel->getContainer()->get('event_dispatcher')); @@ -89,5 +92,7 @@ protected function registerCommands() $bundle->registerCommands($this); } } + + $this->commandsRegistered = true; } }