Skip to content

Commit 42ecd27

Browse files
bug #14272 [FrameworkBundle] Workaround php -S ignoring auto_prepend_file (nicolas-grekas)
This PR was merged into the 2.3 branch. Discussion ---------- [FrameworkBundle] Workaround php -S ignoring auto_prepend_file | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - `php -S front_controller.php` (thus `php app/console server:run`) ignores auto_prepend_file for no reason. Commits ------- dcde445 [FrameworkBundle] Workaround php -S ignoring auto_prepend_file
2 parents 2810e2e + 679735c commit 42ecd27

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

Resources/config/router_dev.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@
2121
* @author: Albert Jessurum <[email protected]>
2222
*/
2323

24+
// Workaround https://bugs.php.net/64566
25+
if (ini_get('auto_prepend_file') && !in_array(realpath(ini_get('auto_prepend_file')), get_included_files(), true)) {
26+
require ini_get('auto_prepend_file');
27+
}
28+
2429
if (is_file($_SERVER['DOCUMENT_ROOT'].DIRECTORY_SEPARATOR.$_SERVER['SCRIPT_NAME'])) {
2530
return false;
2631
}

Resources/config/router_prod.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@
2121
* @author: Albert Jessurum <[email protected]>
2222
*/
2323

24+
// Workaround https://bugs.php.net/64566
25+
if (ini_get('auto_prepend_file') && !in_array(realpath(ini_get('auto_prepend_file')), get_included_files(), true)) {
26+
require ini_get('auto_prepend_file');
27+
}
28+
2429
if (is_file($_SERVER['DOCUMENT_ROOT'].DIRECTORY_SEPARATOR.$_SERVER['SCRIPT_NAME'])) {
2530
return false;
2631
}

0 commit comments

Comments
 (0)