Merge branch 'master' into logformat-awstats
This commit is contained in:
@@ -150,6 +150,8 @@ class FpmDaemons extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
|
||||
* optional, default 0
|
||||
* @param string $limit_extensions
|
||||
* optional, limit execution to the following extensions, default '.php'
|
||||
* @param string $custom_config
|
||||
* optional, custom settings appended to phpfpm pool configuration
|
||||
*
|
||||
* @access admin
|
||||
* @throws \Exception
|
||||
@@ -173,6 +175,7 @@ class FpmDaemons extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
|
||||
$max_requests = $this->getParam('max_requests', true, 0);
|
||||
$idle_timeout = $this->getParam('idle_timeout', true, 0);
|
||||
$limit_extensions = $this->getParam('limit_extensions', true, '.php');
|
||||
$custom_config = $this->getParam('custom_config', true, '');
|
||||
|
||||
// validation
|
||||
$description = \Froxlor\Validate\Validate::validate($description, 'description', '', '', array(), true);
|
||||
@@ -206,7 +209,8 @@ class FpmDaemons extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
|
||||
`max_spare_servers` = :max_spare_servers,
|
||||
`max_requests` = :max_requests,
|
||||
`idle_timeout` = :idle_timeout,
|
||||
`limit_extensions` = :limit_extensions
|
||||
`limit_extensions` = :limit_extensions,
|
||||
`custom_config` = :custom_config
|
||||
");
|
||||
$ins_data = array(
|
||||
'desc' => $description,
|
||||
@@ -219,7 +223,8 @@ class FpmDaemons extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
|
||||
'max_spare_servers' => $max_spare_servers,
|
||||
'max_requests' => $max_requests,
|
||||
'idle_timeout' => $idle_timeout,
|
||||
'limit_extensions' => $limit_extensions
|
||||
'limit_extensions' => $limit_extensions,
|
||||
'custom_config' => $custom_config
|
||||
);
|
||||
Database::pexecute($ins_stmt, $ins_data);
|
||||
$id = Database::lastInsertId();
|
||||
@@ -261,6 +266,8 @@ class FpmDaemons extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
|
||||
* optional, default 0
|
||||
* @param string $limit_extensions
|
||||
* optional, limit execution to the following extensions, default '.php'
|
||||
* @param string $custom_config
|
||||
* optional, custom settings appended to phpfpm pool configuration
|
||||
*
|
||||
* @access admin
|
||||
* @throws \Exception
|
||||
@@ -289,6 +296,7 @@ class FpmDaemons extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
|
||||
$max_requests = $this->getParam('max_requests', true, $result['max_requests']);
|
||||
$idle_timeout = $this->getParam('idle_timeout', true, $result['idle_timeout']);
|
||||
$limit_extensions = $this->getParam('limit_extensions', true, $result['limit_extensions']);
|
||||
$custom_config = $this->getParam('custom_config', true, $result['custom_config']);
|
||||
|
||||
// validation
|
||||
$description = \Froxlor\Validate\Validate::validate($description, 'description', '', '', array(), true);
|
||||
@@ -322,7 +330,8 @@ class FpmDaemons extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
|
||||
`max_spare_servers` = :max_spare_servers,
|
||||
`max_requests` = :max_requests,
|
||||
`idle_timeout` = :idle_timeout,
|
||||
`limit_extensions` = :limit_extensions
|
||||
`limit_extensions` = :limit_extensions,
|
||||
`custom_config` = :custom_config
|
||||
WHERE `id` = :id
|
||||
");
|
||||
$upd_data = array(
|
||||
@@ -337,6 +346,7 @@ class FpmDaemons extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
|
||||
'max_requests' => $max_requests,
|
||||
'idle_timeout' => $idle_timeout,
|
||||
'limit_extensions' => $limit_extensions,
|
||||
'custom_config' => $custom_config,
|
||||
'id' => $id
|
||||
);
|
||||
Database::pexecute($upd_stmt, $upd_data, true, true);
|
||||
|
||||
@@ -115,6 +115,7 @@ class Fpm
|
||||
$fpm_requests = (int) $this->fpm_cfg['max_requests'];
|
||||
$fpm_process_idle_timeout = (int) $this->fpm_cfg['idle_timeout'];
|
||||
$fpm_limit_extensions = $this->fpm_cfg['limit_extensions'];
|
||||
$fpm_custom_config = $this->fpm_cfg['custom_config'];
|
||||
|
||||
if ($fpm_children == 0) {
|
||||
$fpm_children = 1;
|
||||
@@ -260,6 +261,12 @@ class Fpm
|
||||
$fpm_config .= 'php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f ' . $this->domain['email'] . "\n";
|
||||
}
|
||||
|
||||
// append custom phpfpm configuration
|
||||
if (! empty($fpm_custom_config)) {
|
||||
$fpm_config .= "\n; Custom Configuration\n";
|
||||
$fpm_config .= \Froxlor\PhpHelper::replaceVariables($fpm_custom_config, $php_ini_variables);
|
||||
}
|
||||
|
||||
fwrite($fh, $fpm_config, strlen($fpm_config));
|
||||
fclose($fh);
|
||||
}
|
||||
|
||||
@@ -86,6 +86,13 @@ return array(
|
||||
'desc' => $lng['serversettings']['phpfpm_settings']['limit_extensions']['description'],
|
||||
'type' => 'text',
|
||||
'value' => '.php'
|
||||
),
|
||||
'custom_config' => array(
|
||||
'label' => $lng['serversettings']['phpfpm_settings']['custom_config']['title'],
|
||||
'desc' => $lng['serversettings']['phpfpm_settings']['custom_config']['description'],
|
||||
'type' => 'textarea',
|
||||
'cols' => 50,
|
||||
'rows' => 7
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -87,6 +87,14 @@ return array(
|
||||
'desc' => $lng['serversettings']['phpfpm_settings']['limit_extensions']['description'],
|
||||
'type' => 'text',
|
||||
'value' => $result['limit_extensions']
|
||||
),
|
||||
'custom_config' => array(
|
||||
'label' => $lng['serversettings']['phpfpm_settings']['custom_config']['title'],
|
||||
'desc' => $lng['serversettings']['phpfpm_settings']['custom_config']['description'],
|
||||
'type' => 'textarea',
|
||||
'cols' => 50,
|
||||
'rows' => 7,
|
||||
'value' => $result['custom_config']
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user