Commit 4e7b3650 authored by Brian's avatar Brian

Custom PHP variables are not apply when configured in Directive Snippet

PHP variables from Directive Snippets order fix in php.ini
parent a265c649
Pipeline #5386 passed with stage
in 7 minutes and 43 seconds
......@@ -1247,13 +1247,14 @@ class apache2_plugin {
}
//* Create custom php.ini
if(trim($data['new']['custom_php_ini']) != '') {
# Because of custom default PHP directives from snippet
# php.ini custom values order os: 1. general settings 2. Directive Snippets settings 3. custom php.ini settings defined in domain settings
if(trim($data['new']['custom_php_ini']) != '' || $data['new']['directive_snippets_id'] > "0") {
$has_custom_php_ini = true;
$custom_sendmail_path = false;
if(!is_dir($custom_php_ini_dir)) $app->system->mkdirpath($custom_php_ini_dir);
$php_ini_content = $this->get_master_php_ini_content($data['new']);
$php_ini_content .= str_replace("\r", '', trim($data['new']['custom_php_ini']));
if(intval($data['new']['directive_snippets_id']) > 0){
$snippet = $app->db->queryOneRecord("SELECT * FROM directive_snippets WHERE directive_snippets_id = ? AND type = 'apache' AND active = 'y' AND customer_viewable = 'y'", intval($data['new']['directive_snippets_id']));
......@@ -1266,6 +1267,7 @@ class apache2_plugin {
$php_snippet = $app->db->queryOneRecord("SELECT * FROM directive_snippets WHERE directive_snippets_id = ? AND type = 'php' AND active = 'y'", $required_php_snippet);
$php_snippet['snippet'] = trim($php_snippet['snippet']);
if($php_snippet['snippet'] != ''){
$php_snippet['snippet'] = str_replace("\r", '', $php_snippet['snippet']);
$php_ini_content .= "\n".$php_snippet['snippet'];
}
}
......@@ -1273,6 +1275,7 @@ class apache2_plugin {
}
}
}
$php_ini_content .= "\n".str_replace("\r", '', trim($data['new']['custom_php_ini']));
$custom_sendmail_path = false;
$line = strtok($php_ini_content, '\n');
......
Markdown is supported
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