Skip to content

Commit 9c11c4f

Browse files
committed
Merge branch '2.3' into 2.4
* 2.3: Fixed relative redirects for ambiguous paths [BrowserKit] Fix browser kit redirect with ports [TwigBridge] [Form] Fixed some extra empty spaces Plural fix removed some .gitattributes that should have been removed a lot time ago [DependencyInjection] fixed missing 'factory-class' attribute in XmlDumper output fixed whitespace in Twig form template built-in server: exit when docroot does not exist Conflicts: src/Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig
2 parents 0a6f8eb + 61803de commit 9c11c4f

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Command/ServerRunCommand.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,14 @@ protected function configure()
8181
*/
8282
protected function execute(InputInterface $input, OutputInterface $output)
8383
{
84+
$documentRoot = $input->getOption('docroot');
85+
86+
if (!is_dir($documentRoot)) {
87+
$output->writeln(sprintf('<error>The given document root directory "%s" does not exist</error>', $documentRoot));
88+
89+
return 1;
90+
}
91+
8492
$env = $this->getContainer()->getParameter('kernel.environment');
8593

8694
if ('prod' === $env) {
@@ -96,7 +104,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
96104
$output->writeln(sprintf("Server running on <info>http://%s</info>\n", $input->getArgument('address')));
97105

98106
$builder = new ProcessBuilder(array(PHP_BINARY, '-S', $input->getArgument('address'), $router));
99-
$builder->setWorkingDirectory($input->getOption('docroot'));
107+
$builder->setWorkingDirectory($documentRoot);
100108
$builder->setTimeout(null);
101109
$builder->getProcess()->run(function ($type, $buffer) use ($output) {
102110
if (OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) {

0 commit comments

Comments
 (0)