Skip to content

Commit

Permalink
[FrameworkBundle] made log output optional depending on the verbose flag
Browse files Browse the repository at this point in the history
  • Loading branch information
fabpot committed Mar 23, 2012
1 parent 30cd43c commit e1362c6
Showing 1 changed file with 5 additions and 1 deletion.
Expand Up @@ -84,11 +84,15 @@ protected function execute(InputInterface $input, OutputInterface $output)
->locateResource('@FrameworkBundle/Resources/config/router.php')
;

$output->writeln(sprintf("Server running on <info>%s</info>\n", $input->getArgument('address')));

$builder = new ProcessBuilder(array(PHP_BINARY, '-S', $input->getArgument('address'), $router));
$builder->setWorkingDirectory($input->getOption('docroot'));
$builder->setTimeout(null);
$builder->getProcess()->run(function ($type, $buffer) use ($output) {
$output->write($buffer);
if (OutputInterface::VERBOSITY_VERBOSE === $output->getVerbosity()) {
$output->write($buffer);
}
});
}
}

0 comments on commit e1362c6

Please sign in to comment.