Commit 254a4af7 authored by Falko Timme's avatar Falko Timme
Browse files

- Fixed FS#2436: nginx + php-fpm: commented out custom php.ini settings get into pool config.

parent a5b1a01b
...@@ -2381,27 +2381,31 @@ class apache2_plugin { ...@@ -2381,27 +2381,31 @@ class apache2_plugin {
$ini_settings = explode("\n", $custom_php_ini_settings); $ini_settings = explode("\n", $custom_php_ini_settings);
if(is_array($ini_settings) && !empty($ini_settings)){ if(is_array($ini_settings) && !empty($ini_settings)){
foreach($ini_settings as $ini_setting){ foreach($ini_settings as $ini_setting){
list($key, $value) = explode('=', $ini_setting); $ini_setting = trim($ini_setting);
if($value){ if(substr($ini_setting,0,1) == ';') continue;
$value = trim($value); if(substr($ini_setting,0,1) == '#') continue;
$key = trim($key); if(substr($ini_setting,0,2) == '//') continue;
switch (strtolower($value)) { list($key, $value) = explode('=', $ini_setting);
case '0': if($value){
// PHP-FPM might complain about invalid boolean value if you use 0 $value = trim($value);
$value = 'off'; $key = trim($key);
case '1': switch (strtolower($value)) {
case 'on': case '0':
case 'off': // PHP-FPM might complain about invalid boolean value if you use 0
case 'true': $value = 'off';
case 'false': case '1':
case 'yes': case 'on':
case 'no': case 'off':
$final_php_ini_settings[] = array('ini_setting' => 'php_admin_flag['.$key.'] = '.$value); case 'true':
break; case 'false':
default: case 'yes':
$final_php_ini_settings[] = array('ini_setting' => 'php_admin_value['.$key.'] = '.$value); case 'no':
} $final_php_ini_settings[] = array('ini_setting' => 'php_admin_flag['.$key.'] = '.$value);
break;
default:
$final_php_ini_settings[] = array('ini_setting' => 'php_admin_value['.$key.'] = '.$value);
} }
}
} }
} }
} }
......
...@@ -1908,27 +1908,31 @@ class nginx_plugin { ...@@ -1908,27 +1908,31 @@ class nginx_plugin {
$ini_settings = explode("\n", $custom_php_ini_settings); $ini_settings = explode("\n", $custom_php_ini_settings);
if(is_array($ini_settings) && !empty($ini_settings)){ if(is_array($ini_settings) && !empty($ini_settings)){
foreach($ini_settings as $ini_setting){ foreach($ini_settings as $ini_setting){
list($key, $value) = explode('=', $ini_setting); $ini_setting = trim($ini_setting);
if($value){ if(substr($ini_setting,0,1) == ';') continue;
$value = trim($value); if(substr($ini_setting,0,1) == '#') continue;
$key = trim($key); if(substr($ini_setting,0,2) == '//') continue;
switch (strtolower($value)) { list($key, $value) = explode('=', $ini_setting);
case '0': if($value){
// PHP-FPM might complain about invalid boolean value if you use 0 $value = trim($value);
$value = 'off'; $key = trim($key);
case '1': switch (strtolower($value)) {
case 'on': case '0':
case 'off': // PHP-FPM might complain about invalid boolean value if you use 0
case 'true': $value = 'off';
case 'false': case '1':
case 'yes': case 'on':
case 'no': case 'off':
$final_php_ini_settings[] = array('ini_setting' => 'php_admin_flag['.$key.'] = '.$value); case 'true':
break; case 'false':
default: case 'yes':
$final_php_ini_settings[] = array('ini_setting' => 'php_admin_value['.$key.'] = '.$value); case 'no':
} $final_php_ini_settings[] = array('ini_setting' => 'php_admin_flag['.$key.'] = '.$value);
break;
default:
$final_php_ini_settings[] = array('ini_setting' => 'php_admin_value['.$key.'] = '.$value);
} }
}
} }
} }
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment