From 842f3fa3d28d72910059d83e268a708a9005035d Mon Sep 17 00:00:00 2001 From: Tom Maguire Date: Mon, 10 Jun 2013 14:35:49 +0100 Subject: [PATCH] do not re-register commands each time a Console\Application is run --- src/Symfony/Bundle/FrameworkBundle/Console/Application.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/Console/Application.php b/src/Symfony/Bundle/FrameworkBundle/Console/Application.php index e478c51723..6df31ae69b 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Console/Application.php +++ b/src/Symfony/Bundle/FrameworkBundle/Console/Application.php @@ -27,6 +27,7 @@ use Symfony\Component\HttpKernel\Bundle\Bundle; class Application extends BaseApplication { private $kernel; + private $commandsRegistered = false; /** * Constructor. @@ -65,7 +66,9 @@ class Application extends BaseApplication */ 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); @@ -87,5 +90,7 @@ class Application extends BaseApplication $bundle->registerCommands($this); } } + + $this->commandsRegistered = true; } }