Skip to content

Commit

Permalink
Automatically start server:run if server:start failed
Browse files Browse the repository at this point in the history
  • Loading branch information
wouterj committed Apr 3, 2015
1 parent aae98a9 commit f95d89c
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

namespace Symfony\Bundle\FrameworkBundle\Command;

use Symfony\Component\Console\Question\ConfirmationQuestion;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
Expand Down Expand Up @@ -75,6 +76,12 @@ protected function execute(InputInterface $input, OutputInterface $output)
$output->writeln('<error>This command needs the pcntl extension to run.</error>');
$output->writeln('You can either install it or use the <info>server:run</info> command instead to run the built-in web server.');

if ($this->getHelper('question')->ask($input, $output, new ConfirmationQuestion('Do you want to start <info>server:run</info> immediately? [Yn] ', true))) {
$command = $this->getApplication()->find('server:run');

return $command->run($input, $output);
}

return 1;
}

Expand Down

0 comments on commit f95d89c

Please sign in to comment.