diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/ServerRunCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/ServerRunCommand.php index da66bb9615..5f3ea5dffb 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/ServerRunCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/ServerRunCommand.php @@ -44,7 +44,7 @@ class ServerRunCommand extends ContainerAwareCommand $this ->setDefinition(array( new InputArgument('address', InputArgument::OPTIONAL, 'Address:port', 'localhost:8000'), - new InputOption('docroot', 'd', InputOption::VALUE_REQUIRED, 'Document root', 'web/'), + new InputOption('docroot', 'd', InputOption::VALUE_REQUIRED, 'Document root', null), new InputOption('router', 'r', InputOption::VALUE_REQUIRED, 'Path to custom router script'), )) ->setName('server:run') @@ -83,6 +83,10 @@ EOF { $documentRoot = $input->getOption('docroot'); + if (null === $documentRoot) { + $documentRoot = $this->getContainer()->getParameter('kernel.root_dir').'/../web'; + } + if (!is_dir($documentRoot)) { $output->writeln(sprintf('The given document root directory "%s" does not exist', $documentRoot));