Skip to content

Commit 05888ce

Browse files
author
Amrouche Hamza
committed
[WebServerBundle] fix a bug where require would not require the good file because of env
1 parent 77104a1 commit 05888ce

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/Symfony/Bundle/WebServerBundle/Resources/router.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@
3232

3333
$script = getenv('APP_FRONT_CONTROLLER') ?: 'index.php';
3434

35+
if (isset($_ENV['APP_FRONT_CONTROLLER']) && false === getenv('APP_FRONT_CONTROLLER')) {
36+
$script = $_ENV['APP_FRONT_CONTROLLER'];
37+
}
38+
3539
$_SERVER = array_merge($_SERVER, $_ENV);
3640
$_SERVER['SCRIPT_FILENAME'] = $_SERVER['DOCUMENT_ROOT'].DIRECTORY_SEPARATOR.$script;
3741

src/Symfony/Bundle/WebServerBundle/WebServerConfig.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ public function __construct($documentRoot, $env, $address = null, $router = null
3333
}
3434

3535
putenv('APP_FRONT_CONTROLLER='.$file);
36+
$_ENV['APP_FRONT_CONTROLLER'] = $file;
3637

3738
$this->documentRoot = $documentRoot;
3839
$this->env = $env;

0 commit comments

Comments
 (0)