[WebServerBundle] prevent console.terminate from being fired after stopping server
This commit is contained in:
parent
9b3bf5d63f
commit
699339eb0c
@ -19,6 +19,7 @@ use Symfony\Component\Console\Input\InputOption;
|
||||
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 @@ EOF
|
||||
$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'))) {
|
||||
|
Reference in New Issue
Block a user