diff --git a/src/Symfony/Bundle/WebServerBundle/Command/ServerStartCommand.php b/src/Symfony/Bundle/WebServerBundle/Command/ServerStartCommand.php index c762292303116..09d368610ab00 100644 --- a/src/Symfony/Bundle/WebServerBundle/Command/ServerStartCommand.php +++ b/src/Symfony/Bundle/WebServerBundle/Command/ServerStartCommand.php @@ -19,6 +19,7 @@ use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Output\ConsoleOutputInterface; use Symfony\Component\Console\Style\SymfonyStyle; +use Symfony\Component\EventDispatcher\EventDispatcher; /** * Runs a local web server in a background process. @@ -132,6 +133,10 @@ protected function execute(InputInterface $input, OutputInterface $output) $io->error('Running this server in production environment is NOT recommended!'); } + // replace event dispatcher with an empty one to prevent console.terminate from firing + // as container could have changed between start and stop + $this->getApplication()->setDispatcher(new EventDispatcher()); + try { $server = new WebServer(); if ($server->isRunning($input->getOption('pidfile'))) {