Skip to content

Commit d909462

Browse files
committed
Ensure PHP prepending also runs any existing prepend scripts
1 parent e0a0436 commit d909462

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/interceptors/terminal-wrappers/prepend.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,15 @@
44
'http' => array('proxy' => 'localhost:8000')
55
)
66
);
7+
8+
// We've overridden php.ini to ensure this runs. We should go back to
9+
// php.ini, check if there was a previous value, and ensure that
10+
// gets run as well, to make sure we don't break anything.
11+
$phpIniLocation = php_ini_loaded_file();
12+
if ($phpIniLocation) {
13+
$phpIniContents = parse_ini_file($phpIniLocation);
14+
if ($phpIniContents['auto_prepend_file']) {
15+
require($phpIniContents['auto_prepend_file']);
16+
}
17+
}
718
?>

0 commit comments

Comments
 (0)