[WebServerBundle] fix a bug where require would not require the good file because of env

This commit is contained in:
Amrouche Hamza 2017-12-16 17:37:44 +01:00
parent e273d8107e
commit bfeee1f011
No known key found for this signature in database
GPG Key ID: 6968F2785ED4F012
4 changed files with 4 additions and 4 deletions

View File

@ -30,7 +30,7 @@ if (is_file($_SERVER['DOCUMENT_ROOT'].DIRECTORY_SEPARATOR.$_SERVER['SCRIPT_NAME'
return false;
}
$script = getenv('APP_FRONT_CONTROLLER') ?: 'index.php';
$script = isset($_ENV['APP_FRONT_CONTROLLER']) ? $_ENV['APP_FRONT_CONTROLLER'] : 'index.php';
$_SERVER = array_merge($_SERVER, $_ENV);
$_SERVER['SCRIPT_FILENAME'] = $_SERVER['DOCUMENT_ROOT'].DIRECTORY_SEPARATOR.$script;

View File

@ -150,7 +150,7 @@ class WebServer
throw new \RuntimeException('Unable to find the PHP binary.');
}
$process = new Process(array($binary, '-S', $config->getAddress(), $config->getRouter()));
$process = new Process(array($binary, '-dvariables_order=EGPCS', '-S', $config->getAddress(), $config->getRouter()));
$process->setWorkingDirectory($config->getDocumentRoot());
$process->setTimeout(null);

View File

@ -32,7 +32,7 @@ class WebServerConfig
throw new \InvalidArgumentException(sprintf('Unable to find the front controller under "%s" (none of these files exist: %s).', $documentRoot, implode(', ', $this->getFrontControllerFileNames($env))));
}
putenv('APP_FRONT_CONTROLLER='.$file);
$_ENV['APP_FRONT_CONTROLLER'] = $file;
$this->documentRoot = $documentRoot;
$this->env = $env;

View File

@ -19,7 +19,7 @@
"php": "^5.5.9|>=7.0.8",
"symfony/console": "~3.3",
"symfony/http-kernel": "~3.3",
"symfony/process": "~3.3"
"symfony/process": "~3.3.14"
},
"autoload": {
"psr-4": { "Symfony\\Bundle\\WebServerBundle\\": "" },