Skip to content

Commit 679735c

Browse files
[FrameworkBundle] Workaround php -S ignoring auto_prepend_file
1 parent b516b9e commit 679735c

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)