From 445513c1a26f7f1639fad2f622ce12f7491dfd88 Mon Sep 17 00:00:00 2001 From: ftimme <ft@falkotimme.com> Date: Tue, 27 Sep 2011 08:28:22 -0400 Subject: [PATCH] - Added PHP-FPM pm settings (pm.max_children, pm.start_servers, pm.min_spare_servers, pm.max_spare_servers) to the "Options" tab of a website. --- interface/web/sites/web_domain_edit.php | 24 ++++++++++++++++-------- 1 files changed, 16 insertions(+), 8 deletions(-) diff --git a/interface/web/sites/web_domain_edit.php b/interface/web/sites/web_domain_edit.php index 13af0a1..dff5148 100644 --- a/interface/web/sites/web_domain_edit.php +++ b/interface/web/sites/web_domain_edit.php @@ -418,15 +418,23 @@ if(isset($this->dataRecord["domain"])) $this->dataRecord["domain"] = strtolower($this->dataRecord["domain"]); //* get the server config for this server - $app->uses("getconf"); - $web_config = $app->getconf->get_server_config(intval($this->dataRecord["server_id"]),'web'); - //* Check for duplicate ssl certs per IP if SNI is disabled - if(isset($this->dataRecord['ssl']) && $this->dataRecord['ssl'] == 'y' && $web_config['enable_sni'] != 'y') { - $sql = "SELECT count(domain_id) as number FROM web_domain WHERE `ssl` = 'y' AND ip_address = '".$app->db->quote($this->dataRecord['ip_address'])."' and domain_id != ".$this->id; - $tmp = $app->db->queryOneRecord($sql); - if($tmp['number'] > 0) $app->tform->errorMessage .= $app->tform->lng("error_no_sni_txt"); - } + $app->uses("getconf"); + $web_config = $app->getconf->get_server_config(intval($this->dataRecord["server_id"]),'web'); + //* Check for duplicate ssl certs per IP if SNI is disabled + if(isset($this->dataRecord['ssl']) && $this->dataRecord['ssl'] == 'y' && $web_config['enable_sni'] != 'y') { + $sql = "SELECT count(domain_id) as number FROM web_domain WHERE `ssl` = 'y' AND ip_address = '".$app->db->quote($this->dataRecord['ip_address'])."' and domain_id != ".$this->id; + $tmp = $app->db->queryOneRecord($sql); + if($tmp['number'] > 0) $app->tform->errorMessage .= $app->tform->lng("error_no_sni_txt"); + } + // Check if pm.max_children >= pm.max_spare_servers >= pm.start_servers >= pm.min_spare_servers > 0 + if(isset($this->dataRecord['pm_max_children'])) { + if(intval($this->dataRecord['pm_max_children']) >= intval($this->dataRecord['pm_max_spare_servers']) && intval($this->dataRecord['pm_max_spare_servers']) >= intval($this->dataRecord['pm_start_servers']) && intval($this->dataRecord['pm_start_servers']) >= intval($this->dataRecord['pm_min_spare_servers']) && intval($this->dataRecord['pm_min_spare_servers']) > 0){ + + } else { + $app->tform->errorMessage .= $app->tform->lng("error_php_fpm_pm_settings_txt").'<br>'; + } + } parent::onSubmit(); } -- Gitblit v1.9.1