[WebServerBundle] fix a bug where require would not require the good file because of env
This commit is contained in:
parent
e273d8107e
commit
bfeee1f011
@ -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;
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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\\": "" },
|
||||
|
Reference in New Issue
Block a user