Skip to content

Commit 1e0d9bc

Browse files
committed
allow overriding default INI values in extensions
Signed-off-by: Dorian Savina <[email protected]>
1 parent 8078263 commit 1e0d9bc

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

utils/generate_conf.php

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,6 @@
88

99
// Reading environment variables from $_SERVER (because $_ENV is not necessarily populated, depending on variables_order directive):
1010

11-
foreach ($_SERVER as $key => $value) {
12-
if (strpos($key, 'PHP_INI_') === 0) {
13-
$iniParam = substr($key, 8);
14-
if ($iniParam !== 'SMTP') {
15-
// SMTP is the only php.ini parameter that contains uppercase letters (!)
16-
$iniParam = strtolower($iniParam);
17-
}
18-
$iniParam = str_replace('__', '.', $iniParam);
19-
// Let's protect the value if this is a string.
20-
if (!is_numeric($value) && $iniParam !== 'error_reporting') {
21-
$value = '"'.str_replace('"', '\\"', $value).'"';
22-
}
23-
echo "$iniParam=$value\n";
24-
}
25-
}
26-
2711
if (enableExtension('xdebug')) {
2812
//echo "zend_extension=xdebug.so\n";
2913
echo "xdebug.client_host=".getenv('XDEBUG_CLIENT_HOST')."\n";
@@ -40,3 +24,19 @@
4024
//echo "extension=blackfire.so\n";
4125
echo "blackfire.agent_socket=tcp://$blackFireAgent:8707\n";
4226
}
27+
28+
foreach ($_SERVER as $key => $value) {
29+
if (strpos($key, 'PHP_INI_') === 0) {
30+
$iniParam = substr($key, 8);
31+
if ($iniParam !== 'SMTP') {
32+
// SMTP is the only php.ini parameter that contains uppercase letters (!)
33+
$iniParam = strtolower($iniParam);
34+
}
35+
$iniParam = str_replace('__', '.', $iniParam);
36+
// Let's protect the value if this is a string.
37+
if (!is_numeric($value) && $iniParam !== 'error_reporting') {
38+
$value = '"'.str_replace('"', '\\"', $value).'"';
39+
}
40+
echo "$iniParam=$value\n";
41+
}
42+
}

0 commit comments

Comments
 (0)