added new config option for php fpm fixes #1089
This commit is contained in:
@@ -56,7 +56,7 @@ return array(
|
||||
),
|
||||
/*
|
||||
* @TODO implement if phpfpm knows custom php.ini files
|
||||
*
|
||||
*
|
||||
'system_phpfpm_defaultini_ownvhost' => array(
|
||||
'label' => $lng['serversettings']['mod_fcgid']['defaultini_ownvhost'],
|
||||
'settinggroup' => 'phpfpm',
|
||||
@@ -77,6 +77,15 @@ return array(
|
||||
'default' => '/etc/php-fpm.d/',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_phpfpm_aliasconfigdir' => array(
|
||||
'label' => $lng['serversettings']['phpfpm_settings']['aliasconfigdir'],
|
||||
'settinggroup' => 'phpfpm',
|
||||
'varname' => 'aliasconfigdir',
|
||||
'type' => 'string',
|
||||
'string_type' => 'dir',
|
||||
'default' => '/var/www/php-fpm/',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_phpfpm_tmpdir' => array(
|
||||
'label' => $lng['serversettings']['mod_fcgid']['tmpdir'],
|
||||
'settinggroup' => 'phpfpm',
|
||||
|
||||
@@ -1642,7 +1642,7 @@ if(isFroxlorVersion('0.9.22-svn1'))
|
||||
|
||||
/* fix backup_dir for #186 */
|
||||
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = '/var/customers/backups/' WHERE `varname` = 'backup_dir';");
|
||||
|
||||
|
||||
updateToVersion('0.9.22-svn2');
|
||||
}
|
||||
|
||||
@@ -1650,7 +1650,7 @@ if(isFroxlorVersion('0.9.22-svn2'))
|
||||
{
|
||||
showUpdateStep("Updating from 0.9.22-svn2 to 0.9.22-rc1");
|
||||
lastStepStatus(0);
|
||||
|
||||
|
||||
updateToVersion('0.9.22-rc1');
|
||||
}
|
||||
|
||||
@@ -1658,7 +1658,7 @@ if(isFroxlorVersion('0.9.22-rc1'))
|
||||
{
|
||||
showUpdateStep("Updating from 0.9.22-rc1 to 0.9.22");
|
||||
lastStepStatus(0);
|
||||
|
||||
|
||||
updateToVersion('0.9.22');
|
||||
}
|
||||
|
||||
@@ -1729,10 +1729,10 @@ if(isFroxlorVersion('0.9.25'))
|
||||
{
|
||||
showUpdateStep("Updating from 0.9.25 to 0.9.26-svn1");
|
||||
lastStepStatus(0);
|
||||
|
||||
|
||||
// enable bind by default
|
||||
$db->query("INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES ('system', 'bind_enable', '1')");
|
||||
|
||||
|
||||
updateToVersion('0.9.26-svn1');
|
||||
}
|
||||
|
||||
@@ -1756,24 +1756,24 @@ if(isFroxlorVersion('0.9.26'))
|
||||
{
|
||||
showUpdateStep("Updating from 0.9.26 to 0.9.27-svn1");
|
||||
lastStepStatus(0);
|
||||
|
||||
|
||||
// check for multiple backup_ftp_enabled entries
|
||||
$handle = $db->query("SELECT `value` FROM `panel_settings` WHERE `varname` = 'backup_ftp_enabled';");
|
||||
|
||||
|
||||
// if there are more than one entry try to fix it
|
||||
if ($db->num_rows($handle) > 1) {
|
||||
$rows = $db->fetch_array($handle);
|
||||
$state = false;
|
||||
|
||||
|
||||
// iterate through all found entries
|
||||
// and try to guess what value it should be
|
||||
foreach ($rows as $row) {
|
||||
$state = $state | $row['value'];
|
||||
}
|
||||
|
||||
|
||||
// now delete all entries
|
||||
$db->query("DELETE FROM `panel_settings` WHERE `varname` = 'backup_ftp_enabled';");
|
||||
|
||||
|
||||
// and re-add it
|
||||
$db->query("INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES ('system', 'backup_ftp_enabled', '". $state ."');");
|
||||
}
|
||||
@@ -1785,18 +1785,18 @@ if(isFroxlorVersion('0.9.27-svn1'))
|
||||
{
|
||||
showUpdateStep("Updating from 0.9.27-svn1 to 0.9.27-svn2");
|
||||
lastStepStatus(0);
|
||||
|
||||
|
||||
// Get FastCGI timeout setting if available
|
||||
$handle = $db->query("SELECT `value` FROM `panel_settings` WHERE `settinggroup` = 'system' AND `varname` = 'mod_fcgid_idle_timeout';");
|
||||
|
||||
|
||||
// If timeout is set then skip
|
||||
if ($db->num_rows($handle) < 1) {
|
||||
$db->query("INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES ('system', 'mod_fcgid_idle_timeout', '30');");
|
||||
}
|
||||
|
||||
|
||||
// Get FastCGI timeout setting if available
|
||||
$handle = $db->query("SELECT `value` FROM `panel_settings` WHERE `settinggroup` = 'phpfpm' AND `varname` = 'idle_timeout';");
|
||||
|
||||
|
||||
// If timeout is set then skip
|
||||
if ($db->num_rows($handle) < 1) {
|
||||
$db->query("INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES ('phpfpm', 'idle_timeout', '30');");
|
||||
@@ -1821,3 +1821,17 @@ if(isFroxlorVersion('0.9.27-rc1'))
|
||||
updateToVersion('0.9.27');
|
||||
}
|
||||
|
||||
if(isFroxlorVersion('0.9.27')) {
|
||||
showUpdateStep("Updating from 0.9.27 to 0.9.28-fpmfix");
|
||||
lastStepStatus(0);
|
||||
|
||||
// Get AliasconfigDir setting if available
|
||||
$handle = $db->query("SELECT `value` FROM `panel_settings` WHERE `settinggroup` = 'phpfpm' AND `varname` = 'aliasconfigdir';");
|
||||
|
||||
// If AliasconfigDir is set then skip
|
||||
if ($db->num_rows($handle) < 1) {
|
||||
$db->query("INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES ('phpfpm', 'aliasconfigdir', '/var/www/php-fpm/');");
|
||||
}
|
||||
|
||||
updateToVersion('0.9.28-fpmfix');
|
||||
}
|
||||
|
||||
@@ -243,12 +243,11 @@ class phpinterface_fpm
|
||||
public function getAliasConfigDir($createifnotexists = true)
|
||||
{
|
||||
// ensure default...
|
||||
if (!isset($this->_settings['system']['phpfpm_aliasconfigdir'])) {
|
||||
$this->_settings['system']['phpfpm_aliasconfigdir'] = '/var/www/php-fpm';
|
||||
if (!isset($this->_settings['phpfpm']['aliasconfigdir'])) {
|
||||
$this->_settings['phpfpm']['aliasconfigdir'] = '/var/www/php-fpm';
|
||||
}
|
||||
|
||||
$configdir = makeCorrectDir($this->_settings['system']['phpfpm_aliasconfigdir'] . '/' . $this->_domain['loginname'] . '/' . $this->_domain['domain'] . '/');
|
||||
|
||||
$configdir = makeCorrectDir($this->_settings['phpfpm']['aliasconfigdir'] . '/' . $this->_domain['loginname'] . '/' . $this->_domain['domain'] . '/');
|
||||
if(!is_dir($configdir) && $createifnotexists)
|
||||
{
|
||||
safe_exec('mkdir -p ' . escapeshellarg($configdir));
|
||||
|
||||
@@ -37,7 +37,7 @@ function processForm(&$form, &$input, $url_params = array())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
foreach($form['groups'] as $groupname => $groupdetails)
|
||||
{
|
||||
if(validateFieldDefinition($groupdetails))
|
||||
@@ -46,7 +46,7 @@ function processForm(&$form, &$input, $url_params = array())
|
||||
foreach($groupdetails['fields'] as $fieldname => $fielddetails)
|
||||
{
|
||||
$newfieldvalue = getFormFieldData($fieldname, $fielddetails, $input);
|
||||
|
||||
|
||||
if($newfieldvalue != $fielddetails['value'])
|
||||
{
|
||||
if(($error = validateFormField($fieldname, $fielddetails, $newfieldvalue)) !== true)
|
||||
@@ -173,13 +173,13 @@ function processFormEx(&$form, &$input, $url_params = array(), $part, $settings_
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
foreach($form['groups'] as $groupname => $groupdetails)
|
||||
{
|
||||
if(($settings_part && $part == $groupname)
|
||||
|| $settings_all
|
||||
|| $only_enabledisable
|
||||
){
|
||||
){
|
||||
if(validateFieldDefinition($groupdetails))
|
||||
{
|
||||
// Validate fields
|
||||
@@ -189,7 +189,6 @@ function processFormEx(&$form, &$input, $url_params = array(), $part, $settings_
|
||||
|| ($only_enabledisable && isset($fielddetails['overview_option']))
|
||||
) {
|
||||
$newfieldvalue = getFormFieldData($fieldname, $fielddetails, $input);
|
||||
|
||||
if($newfieldvalue != $fielddetails['value'])
|
||||
{
|
||||
if(($error = validateFormField($fieldname, $fielddetails, $newfieldvalue)) !== true)
|
||||
@@ -201,7 +200,7 @@ function processFormEx(&$form, &$input, $url_params = array(), $part, $settings_
|
||||
$changed_fields[$fieldname] = $newfieldvalue;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$submitted_fields[$fieldname] = $newfieldvalue;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ function storeSettingField($fieldname, $fielddata, $newfieldvalue)
|
||||
{
|
||||
if(is_array($fielddata) && isset($fielddata['settinggroup']) && $fielddata['settinggroup'] != '' && isset($fielddata['varname']) && $fielddata['varname'] != '')
|
||||
{
|
||||
|
||||
if(saveSetting($fielddata['settinggroup'], $fielddata['varname'], $newfieldvalue) != false)
|
||||
{
|
||||
/*
|
||||
@@ -30,7 +31,7 @@ function storeSettingField($fieldname, $fielddata, $newfieldvalue)
|
||||
{
|
||||
toggleCronStatus($fielddata['cronmodule'], $newfieldvalue);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* satisfy dependencies
|
||||
*/
|
||||
@@ -47,7 +48,7 @@ function storeSettingField($fieldname, $fielddata, $newfieldvalue)
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -66,7 +67,7 @@ function storeSettingFieldInsertBindTask($fieldname, $fielddata, $newfieldvalue)
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -1527,6 +1527,7 @@ $lng['error']['intvaluetoohigh'] = 'The given number is too high (field %s)';
|
||||
$lng['admin']['phpfpm_settings'] = 'PHP-FPM';
|
||||
$lng['serversettings']['phpfpm'] = 'Enable php-fpm';
|
||||
$lng['serversettings']['phpfpm_settings']['configdir'] = 'Configuration directory of php-fpm';
|
||||
$lng['serversettings']['phpfpm_settings']['aliasconfigdir'] = 'Configuration Alias-directory of php-fpm';
|
||||
$lng['serversettings']['phpfpm_settings']['reload'] = 'php-fpm restart command';
|
||||
$lng['serversettings']['phpfpm_settings']['pm'] = 'Process manager control (pm)';
|
||||
$lng['serversettings']['phpfpm_settings']['max_children']['title'] = 'The number of child processes';
|
||||
|
||||
Reference in New Issue
Block a user