[WebServerBundle] allowed public/ root directory to be auto-discovered along side web/
This commit is contained in:
parent
bc6b57c208
commit
34c8566be1
@ -88,6 +88,12 @@ EOF
|
||||
{
|
||||
$io = new SymfonyStyle($input, $output instanceof ConsoleOutputInterface ? $output->getErrorOutput() : $output);
|
||||
|
||||
// deprecated, logic to be removed in 4.0
|
||||
// this allows the commands to work out of the box with web/ and public/
|
||||
if ($this->documentRoot && !is_dir($this->documentRoot) && is_dir(dirname($this->documentRoot).'/web')) {
|
||||
$this->documentRoot = dirname($this->documentRoot).'/web';
|
||||
}
|
||||
|
||||
if (null === $documentRoot = $input->getOption('docroot')) {
|
||||
if (!$this->documentRoot) {
|
||||
$io->error('The document root directory must be either passed as first argument of the constructor or through the "--docroot" input option.');
|
||||
|
@ -100,6 +100,12 @@ EOF
|
||||
return 1;
|
||||
}
|
||||
|
||||
// deprecated, logic to be removed in 4.0
|
||||
// this allows the commands to work out of the box with web/ and public/
|
||||
if ($this->documentRoot && !is_dir($this->documentRoot) && is_dir(dirname($this->documentRoot).'/web')) {
|
||||
$this->documentRoot = dirname($this->documentRoot).'/web';
|
||||
}
|
||||
|
||||
if (null === $documentRoot = $input->getOption('docroot')) {
|
||||
if (!$this->documentRoot) {
|
||||
$io->error('The document root directory must be either passed as first argument of the constructor or through the "docroot" input option.');
|
||||
|
@ -8,13 +8,13 @@
|
||||
<defaults public="false" />
|
||||
|
||||
<service id="web_server.command.server_run" class="Symfony\Bundle\WebServerBundle\Command\ServerRunCommand">
|
||||
<argument>%kernel.project_dir%/web</argument>
|
||||
<argument>%kernel.project_dir%/public</argument>
|
||||
<argument>%kernel.environment%</argument>
|
||||
<tag name="console.command" />
|
||||
</service>
|
||||
|
||||
<service id="web_server.command.server_start" class="Symfony\Bundle\WebServerBundle\Command\ServerStartCommand">
|
||||
<argument>%kernel.project_dir%/web</argument>
|
||||
<argument>%kernel.project_dir%/public</argument>
|
||||
<argument>%kernel.environment%</argument>
|
||||
<tag name="console.command" />
|
||||
</service>
|
||||
|
Reference in New Issue
Block a user