major refactoring of almost all files

This commit is contained in:
envoyr
2022-04-28 20:48:00 +02:00
parent a2e95b960f
commit 4f4c71d79b
285 changed files with 21716 additions and 18766 deletions

View File

@@ -4,105 +4,114 @@
* This file is part of the Froxlor project.
* Copyright (c) 2010 the Froxlor Team (see authors).
*
* For the full copyright and license information, please view the COPYING
* file that was distributed with this source code. You can also view the
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* @copyright (c) the authors
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Formfields
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you can also view it online at
* https://files.froxlor.org/misc/COPYING.txt
*
* @copyright the authors
* @author Froxlor team <team@froxlor.org>
* @license https://files.froxlor.org/misc/COPYING.txt GPLv2
*/
return array(
'fpmconfig_add' => array(
'title' => $lng['admin']['phpsettings']['addsettings'],
return [
'fpmconfig_add' => [
'title' => lng('admin.phpsettings.addsettings'),
'image' => 'fa-solid fa-plus',
'self_overview' => ['section' => 'phpsettings', 'page' => 'fpmdaemons'],
'sections' => array(
'section_a' => array(
'title' => $lng['admin']['phpsettings']['addsettings'],
'sections' => [
'section_a' => [
'title' => lng('admin.phpsettings.addsettings'),
'image' => 'icons/phpsettings_add.png',
'fields' => array(
'description' => array(
'label' => $lng['admin']['phpsettings']['description'],
'fields' => [
'description' => [
'label' => lng('admin.phpsettings.description'),
'type' => 'text',
'maxlength' => 50
),
'reload_cmd' => array(
'label' => $lng['serversettings']['phpfpm_settings']['reload'],
],
'reload_cmd' => [
'label' => lng('serversettings.phpfpm_settings.reload'),
'type' => 'text',
'maxlength' => 255,
'value' => 'service php7.4-fpm restart'
),
'config_dir' => array(
'label' => $lng['serversettings']['phpfpm_settings']['configdir'],
],
'config_dir' => [
'label' => lng('serversettings.phpfpm_settings.configdir'),
'type' => 'text',
'maxlength' => 255,
'value' => '/etc/php/7.4/fpm/pool.d/'
),
'pm' => array(
'label' => $lng['serversettings']['phpfpm_settings']['pm'],
],
'pm' => [
'label' => lng('serversettings.phpfpm_settings.pm'),
'type' => 'select',
'select_var' => [
'static' => 'static',
'dynamic' => 'dynamic',
'ondemand' => 'ondemand'
]
),
'max_children' => array(
'label' => $lng['serversettings']['phpfpm_settings']['max_children']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['max_children']['description'],
],
'max_children' => [
'label' => lng('serversettings.phpfpm_settings.max_children.title'),
'desc' => lng('serversettings.phpfpm_settings.max_children.description'),
'type' => 'number',
'value' => 5,
'min' => 1
),
'start_servers' => array(
'label' => $lng['serversettings']['phpfpm_settings']['start_servers']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['start_servers']['description'],
],
'start_servers' => [
'label' => lng('serversettings.phpfpm_settings.start_servers.title'),
'desc' => lng('serversettings.phpfpm_settings.start_servers.description'),
'type' => 'number',
'value' => 2,
'min' => 1
),
'min_spare_servers' => array(
'label' => $lng['serversettings']['phpfpm_settings']['min_spare_servers']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['min_spare_servers']['description'],
],
'min_spare_servers' => [
'label' => lng('serversettings.phpfpm_settings.min_spare_servers.title'),
'desc' => lng('serversettings.phpfpm_settings.min_spare_servers.description'),
'type' => 'number',
'value' => 1
),
'max_spare_servers' => array(
'label' => $lng['serversettings']['phpfpm_settings']['max_spare_servers']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['max_spare_servers']['description'],
],
'max_spare_servers' => [
'label' => lng('serversettings.phpfpm_settings.max_spare_servers.title'),
'desc' => lng('serversettings.phpfpm_settings.max_spare_servers.description'),
'type' => 'number',
'value' => 3
),
'max_requests' => array(
'label' => $lng['serversettings']['phpfpm_settings']['max_requests']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['max_requests']['description'],
],
'max_requests' => [
'label' => lng('serversettings.phpfpm_settings.max_requests.title'),
'desc' => lng('serversettings.phpfpm_settings.max_requests.description'),
'type' => 'number',
'value' => 0
),
'idle_timeout' => array(
'label' => $lng['serversettings']['phpfpm_settings']['idle_timeout']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['idle_timeout']['description'],
],
'idle_timeout' => [
'label' => lng('serversettings.phpfpm_settings.idle_timeout.title'),
'desc' => lng('serversettings.phpfpm_settings.idle_timeout.description'),
'type' => 'number',
'value' => 10
),
'limit_extensions' => array(
'label' => $lng['serversettings']['phpfpm_settings']['limit_extensions']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['limit_extensions']['description'],
],
'limit_extensions' => [
'label' => lng('serversettings.phpfpm_settings.limit_extensions.title'),
'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'],
],
'custom_config' => [
'label' => lng('serversettings.phpfpm_settings.custom_config.title'),
'desc' => lng('serversettings.phpfpm_settings.custom_config.description'),
'type' => 'textarea',
'cols' => 50,
'rows' => 7
)
)
)
)
)
);
]
]
]
]
]
];

View File

@@ -4,46 +4,55 @@
* This file is part of the Froxlor project.
* Copyright (c) 2010 the Froxlor Team (see authors).
*
* For the full copyright and license information, please view the COPYING
* file that was distributed with this source code. You can also view the
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* @copyright (c) the authors
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Formfields
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you can also view it online at
* https://files.froxlor.org/misc/COPYING.txt
*
* @copyright the authors
* @author Froxlor team <team@froxlor.org>
* @license https://files.froxlor.org/misc/COPYING.txt GPLv2
*/
return array(
'fpmconfig_edit' => array(
'title' => $lng['admin']['phpsettings']['editsettings'],
return [
'fpmconfig_edit' => [
'title' => lng('admin.phpsettings.editsettings'),
'image' => 'fa-solid fa-pen',
'self_overview' => ['section' => 'phpsettings', 'page' => 'fpmdaemons'],
'sections' => array(
'section_a' => array(
'title' => $lng['admin']['phpsettings']['editsettings'],
'sections' => [
'section_a' => [
'title' => lng('admin.phpsettings.editsettings'),
'image' => 'icons/phpsettings_edit.png',
'fields' => array(
'description' => array(
'label' => $lng['admin']['phpsettings']['description'],
'fields' => [
'description' => [
'label' => lng('admin.phpsettings.description'),
'type' => 'text',
'maxlength' => 50,
'value' => $result['description']
),
'reload_cmd' => array(
'label' => $lng['serversettings']['phpfpm_settings']['reload'],
],
'reload_cmd' => [
'label' => lng('serversettings.phpfpm_settings.reload'),
'type' => 'text',
'maxlength' => 255,
'value' => $result['reload_cmd']
),
'config_dir' => array(
'label' => $lng['serversettings']['phpfpm_settings']['configdir'],
],
'config_dir' => [
'label' => lng('serversettings.phpfpm_settings.configdir'),
'type' => 'text',
'maxlength' => 255,
'value' => $result['config_dir']
),
'pm' => array(
'label' => $lng['serversettings']['phpfpm_settings']['pm'],
],
'pm' => [
'label' => lng('serversettings.phpfpm_settings.pm'),
'type' => 'select',
'select_var' => [
'static' => 'static',
@@ -51,61 +60,61 @@ return array(
'ondemand' => 'ondemand'
],
'selected' => $result['pm']
),
'max_children' => array(
'label' => $lng['serversettings']['phpfpm_settings']['max_children']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['max_children']['description'],
],
'max_children' => [
'label' => lng('serversettings.phpfpm_settings.max_children.title'),
'desc' => lng('serversettings.phpfpm_settings.max_children.description'),
'type' => 'number',
'value' => $result['max_children'],
'min' => 1
),
'start_servers' => array(
'label' => $lng['serversettings']['phpfpm_settings']['start_servers']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['start_servers']['description'],
],
'start_servers' => [
'label' => lng('serversettings.phpfpm_settings.start_servers.title'),
'desc' => lng('serversettings.phpfpm_settings.start_servers.description'),
'type' => 'number',
'value' => $result['start_servers'],
'min' => 1
),
'min_spare_servers' => array(
'label' => $lng['serversettings']['phpfpm_settings']['min_spare_servers']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['min_spare_servers']['description'],
],
'min_spare_servers' => [
'label' => lng('serversettings.phpfpm_settings.min_spare_servers.title'),
'desc' => lng('serversettings.phpfpm_settings.min_spare_servers.description'),
'type' => 'number',
'value' => $result['min_spare_servers']
),
'max_spare_servers' => array(
'label' => $lng['serversettings']['phpfpm_settings']['max_spare_servers']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['max_spare_servers']['description'],
],
'max_spare_servers' => [
'label' => lng('serversettings.phpfpm_settings.max_spare_servers.title'),
'desc' => lng('serversettings.phpfpm_settings.max_spare_servers.description'),
'type' => 'number',
'value' => $result['max_spare_servers']
),
'max_requests' => array(
'label' => $lng['serversettings']['phpfpm_settings']['max_requests']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['max_requests']['description'],
],
'max_requests' => [
'label' => lng('serversettings.phpfpm_settings.max_requests.title'),
'desc' => lng('serversettings.phpfpm_settings.max_requests.description'),
'type' => 'number',
'value' => $result['max_requests']
),
'idle_timeout' => array(
'label' => $lng['serversettings']['phpfpm_settings']['idle_timeout']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['idle_timeout']['description'],
],
'idle_timeout' => [
'label' => lng('serversettings.phpfpm_settings.idle_timeout.title'),
'desc' => lng('serversettings.phpfpm_settings.idle_timeout.description'),
'type' => 'number',
'value' => $result['idle_timeout']
),
'limit_extensions' => array(
'label' => $lng['serversettings']['phpfpm_settings']['limit_extensions']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['limit_extensions']['description'],
],
'limit_extensions' => [
'label' => lng('serversettings.phpfpm_settings.limit_extensions.title'),
'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'],
],
'custom_config' => [
'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']
)
)
)
)
)
);
]
]
]
]
]
];

View File

@@ -4,181 +4,192 @@
* This file is part of the Froxlor project.
* Copyright (c) 2010 the Froxlor Team (see authors).
*
* For the full copyright and license information, please view the COPYING
* file that was distributed with this source code. You can also view the
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* @copyright (c) the authors
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Formfields
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you can also view it online at
* https://files.froxlor.org/misc/COPYING.txt
*
* @copyright the authors
* @author Froxlor team <team@froxlor.org>
* @license https://files.froxlor.org/misc/COPYING.txt GPLv2
*/
return array(
'phpconfig_add' => array(
'title' => $lng['admin']['phpsettings']['addsettings'],
use Froxlor\Settings;
return [
'phpconfig_add' => [
'title' => lng('admin.phpsettings.addsettings'),
'image' => 'fa-solid fa-plus',
'self_overview' => ['section' => 'phpsettings', 'page' => 'overview'],
'sections' => array(
'section_a' => array(
'title' => $lng['admin']['phpsettings']['addsettings'],
'sections' => [
'section_a' => [
'title' => lng('admin.phpsettings.addsettings'),
'image' => 'icons/phpsettings_add.png',
'fields' => array(
'description' => array(
'label' => $lng['admin']['phpsettings']['description'],
'fields' => [
'description' => [
'label' => lng('admin.phpsettings.description'),
'type' => 'text',
'maxlength' => 50
),
'binary' => array(
'visible' => \Froxlor\Settings::Get('system.mod_fcgid') == 1,
'label' => $lng['admin']['phpsettings']['binary'],
],
'binary' => [
'visible' => Settings::Get('system.mod_fcgid') == 1,
'label' => lng('admin.phpsettings.binary'),
'type' => 'text',
'maxlength' => 255,
'value' => '/usr/bin/php-cgi'
),
'fpmconfig' => array(
'visible' => \Froxlor\Settings::Get('phpfpm.enabled') == 1,
'label' => $lng['admin']['phpsettings']['fpmdesc'],
],
'fpmconfig' => [
'visible' => Settings::Get('phpfpm.enabled') == 1,
'label' => lng('admin.phpsettings.fpmdesc'),
'type' => 'select',
'select_var' => $fpmconfigs,
'selected' => 1
),
'file_extensions' => array(
'visible' => \Froxlor\Settings::Get('system.mod_fcgid') == 1,
'label' => $lng['admin']['phpsettings']['file_extensions'],
'desc' => $lng['admin']['phpsettings']['file_extensions_note'],
],
'file_extensions' => [
'visible' => Settings::Get('system.mod_fcgid') == 1,
'label' => lng('admin.phpsettings.file_extensions'),
'desc' => lng('admin.phpsettings.file_extensions_note'),
'type' => 'text',
'maxlength' => 255,
'value' => 'php'
),
'mod_fcgid_starter' => array(
'visible' => \Froxlor\Settings::Get('system.mod_fcgid') == 1,
'label' => $lng['admin']['mod_fcgid_starter']['title'],
],
'mod_fcgid_starter' => [
'visible' => Settings::Get('system.mod_fcgid') == 1,
'label' => lng('admin.mod_fcgid_starter.title'),
'type' => 'number'
),
'mod_fcgid_maxrequests' => array(
'visible' => \Froxlor\Settings::Get('system.mod_fcgid') == 1,
'label' => $lng['admin']['mod_fcgid_maxrequests']['title'],
],
'mod_fcgid_maxrequests' => [
'visible' => Settings::Get('system.mod_fcgid') == 1,
'label' => lng('admin.mod_fcgid_maxrequests.title'),
'type' => 'number'
),
'mod_fcgid_umask' => array(
'visible' => \Froxlor\Settings::Get('system.mod_fcgid') == 1,
'label' => $lng['admin']['mod_fcgid_umask']['title'],
],
'mod_fcgid_umask' => [
'visible' => Settings::Get('system.mod_fcgid') == 1,
'label' => lng('admin.mod_fcgid_umask.title'),
'type' => 'text',
'maxlength' => 3,
'value' => '022'
),
'phpfpm_enable_slowlog' => array(
'visible' => \Froxlor\Settings::Get('phpfpm.enabled') == 1,
'label' => $lng['admin']['phpsettings']['enable_slowlog'],
],
'phpfpm_enable_slowlog' => [
'visible' => Settings::Get('phpfpm.enabled') == 1,
'label' => lng('admin.phpsettings.enable_slowlog'),
'type' => 'checkbox',
'value' => '1',
'checked' => false
),
'phpfpm_reqtermtimeout' => array(
'visible' => \Froxlor\Settings::Get('phpfpm.enabled') == 1,
'label' => $lng['admin']['phpsettings']['request_terminate_timeout'],
],
'phpfpm_reqtermtimeout' => [
'visible' => Settings::Get('phpfpm.enabled') == 1,
'label' => lng('admin.phpsettings.request_terminate_timeout'),
'type' => 'text',
'maxlength' => 10,
'value' => '60s'
),
'phpfpm_reqslowtimeout' => array(
'visible' => \Froxlor\Settings::Get('phpfpm.enabled') == 1,
'label' => $lng['admin']['phpsettings']['request_slowlog_timeout'],
],
'phpfpm_reqslowtimeout' => [
'visible' => Settings::Get('phpfpm.enabled') == 1,
'label' => lng('admin.phpsettings.request_slowlog_timeout'),
'type' => 'text',
'maxlength' => 10,
'value' => '5s'
),
'phpfpm_pass_authorizationheader' => array(
'visible' => \Froxlor\Settings::Get('phpfpm.enabled') == 1,
'label' => $lng['admin']['phpsettings']['pass_authorizationheader'],
],
'phpfpm_pass_authorizationheader' => [
'visible' => Settings::Get('phpfpm.enabled') == 1,
'label' => lng('admin.phpsettings.pass_authorizationheader'),
'type' => 'checkbox',
'value' => '1',
'checked' => false
),
'override_fpmconfig' => array(
'visible' => \Froxlor\Settings::Get('phpfpm.enabled') == 1,
'label' => $lng['serversettings']['phpfpm_settings']['override_fpmconfig'],
],
'override_fpmconfig' => [
'visible' => Settings::Get('phpfpm.enabled') == 1,
'label' => lng('serversettings.phpfpm_settings.override_fpmconfig'),
'type' => 'checkbox',
'value' => '1',
'checked' => false
),
'pm' => array(
'visible' => \Froxlor\Settings::Get('phpfpm.enabled') == 1,
'label' => $lng['serversettings']['phpfpm_settings']['pm'],
'desc' => $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
],
'pm' => [
'visible' => Settings::Get('phpfpm.enabled') == 1,
'label' => lng('serversettings.phpfpm_settings.pm'),
'desc' => lng('serversettings.phpfpm_settings.override_fpmconfig_addinfo'),
'type' => 'select',
'select_var' => [
'static' => 'static',
'dynamic' => 'dynamic',
'ondemand' => 'ondemand'
]
),
'max_children' => array(
'visible' => \Froxlor\Settings::Get('phpfpm.enabled') == 1,
'label' => $lng['serversettings']['phpfpm_settings']['max_children']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['max_children']['description'] . $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
],
'max_children' => [
'visible' => Settings::Get('phpfpm.enabled') == 1,
'label' => lng('serversettings.phpfpm_settings.max_children.title'),
'desc' => lng('serversettings.phpfpm_settings.max_children.description') . lng('serversettings.phpfpm_settings.override_fpmconfig_addinfo'),
'type' => 'number',
'value' => 1
),
'start_servers' => array(
'visible' => \Froxlor\Settings::Get('phpfpm.enabled') == 1,
'label' => $lng['serversettings']['phpfpm_settings']['start_servers']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['start_servers']['description'] . $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
],
'start_servers' => [
'visible' => Settings::Get('phpfpm.enabled') == 1,
'label' => lng('serversettings.phpfpm_settings.start_servers.title'),
'desc' => lng('serversettings.phpfpm_settings.start_servers.description') . lng('serversettings.phpfpm_settings.override_fpmconfig_addinfo'),
'type' => 'number',
'value' => 20
),
'min_spare_servers' => array(
'visible' => \Froxlor\Settings::Get('phpfpm.enabled') == 1,
'label' => $lng['serversettings']['phpfpm_settings']['min_spare_servers']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['min_spare_servers']['description'] . $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
],
'min_spare_servers' => [
'visible' => Settings::Get('phpfpm.enabled') == 1,
'label' => lng('serversettings.phpfpm_settings.min_spare_servers.title'),
'desc' => lng('serversettings.phpfpm_settings.min_spare_servers.description') . lng('serversettings.phpfpm_settings.override_fpmconfig_addinfo'),
'type' => 'number',
'value' => 5
),
'max_spare_servers' => array(
'visible' => \Froxlor\Settings::Get('phpfpm.enabled') == 1,
'label' => $lng['serversettings']['phpfpm_settings']['max_spare_servers']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['max_spare_servers']['description'] . $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
],
'max_spare_servers' => [
'visible' => Settings::Get('phpfpm.enabled') == 1,
'label' => lng('serversettings.phpfpm_settings.max_spare_servers.title'),
'desc' => lng('serversettings.phpfpm_settings.max_spare_servers.description') . lng('serversettings.phpfpm_settings.override_fpmconfig_addinfo'),
'type' => 'number',
'value' => 35
),
'max_requests' => array(
'visible' => \Froxlor\Settings::Get('phpfpm.enabled') == 1,
'label' => $lng['serversettings']['phpfpm_settings']['max_requests']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['max_requests']['description'] . $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
],
'max_requests' => [
'visible' => Settings::Get('phpfpm.enabled') == 1,
'label' => lng('serversettings.phpfpm_settings.max_requests.title'),
'desc' => lng('serversettings.phpfpm_settings.max_requests.description') . lng('serversettings.phpfpm_settings.override_fpmconfig_addinfo'),
'type' => 'number',
'value' => 0
),
'idle_timeout' => array(
'visible' => \Froxlor\Settings::Get('phpfpm.enabled') == 1,
'label' => $lng['serversettings']['phpfpm_settings']['idle_timeout']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['idle_timeout']['description'] . $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
],
'idle_timeout' => [
'visible' => Settings::Get('phpfpm.enabled') == 1,
'label' => lng('serversettings.phpfpm_settings.idle_timeout.title'),
'desc' => lng('serversettings.phpfpm_settings.idle_timeout.description') . lng('serversettings.phpfpm_settings.override_fpmconfig_addinfo'),
'type' => 'number',
'value' => 10
),
'limit_extensions' => array(
'visible' => \Froxlor\Settings::Get('phpfpm.enabled') == 1,
'label' => $lng['serversettings']['phpfpm_settings']['limit_extensions']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['limit_extensions']['description'] . $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
],
'limit_extensions' => [
'visible' => Settings::Get('phpfpm.enabled') == 1,
'label' => lng('serversettings.phpfpm_settings.limit_extensions.title'),
'desc' => lng('serversettings.phpfpm_settings.limit_extensions.description') . lng('serversettings.phpfpm_settings.override_fpmconfig_addinfo'),
'type' => 'text',
'value' => '.php'
),
'phpsettings' => array(
'label' => $lng['admin']['phpsettings']['phpinisettings'],
],
'phpsettings' => [
'label' => lng('admin.phpsettings.phpinisettings'),
'type' => 'textarea',
'cols' => 80,
'rows' => 20,
'value' => $result['phpsettings']
),
'allow_all_customers' => array(
'label' => $lng['serversettings']['phpfpm_settings']['allow_all_customers']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['allow_all_customers']['description'],
],
'allow_all_customers' => [
'label' => lng('serversettings.phpfpm_settings.allow_all_customers.title'),
'desc' => lng('serversettings.phpfpm_settings.allow_all_customers.description'),
'type' => 'checkbox',
'value' => '1',
'checked' => false
)
)
)
)
)
);
]
]
]
]
]
];

View File

@@ -4,111 +4,122 @@
* This file is part of the Froxlor project.
* Copyright (c) 2010 the Froxlor Team (see authors).
*
* For the full copyright and license information, please view the COPYING
* file that was distributed with this source code. You can also view the
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* @copyright (c) the authors
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Formfields
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you can also view it online at
* https://files.froxlor.org/misc/COPYING.txt
*
* @copyright the authors
* @author Froxlor team <team@froxlor.org>
* @license https://files.froxlor.org/misc/COPYING.txt GPLv2
*/
return array(
'phpconfig_edit' => array(
'title' => $lng['admin']['phpsettings']['editsettings'],
use Froxlor\Settings;
return [
'phpconfig_edit' => [
'title' => lng('admin.phpsettings.editsettings'),
'image' => 'fa-solid fa-pen',
'self_overview' => ['section' => 'phpsettings', 'page' => 'overview'],
'sections' => array(
'section_a' => array(
'title' => $lng['admin']['phpsettings']['editsettings'],
'sections' => [
'section_a' => [
'title' => lng('admin.phpsettings.editsettings'),
'image' => 'icons/phpsettings_edit.png',
'fields' => array(
'description' => array(
'label' => $lng['admin']['phpsettings']['description'],
'fields' => [
'description' => [
'label' => lng('admin.phpsettings.description'),
'type' => 'text',
'maxlength' => 50,
'value' => $result['description']
),
'binary' => array(
'visible' => \Froxlor\Settings::Get('system.mod_fcgid') == 1,
'label' => $lng['admin']['phpsettings']['binary'],
],
'binary' => [
'visible' => Settings::Get('system.mod_fcgid') == 1,
'label' => lng('admin.phpsettings.binary'),
'type' => 'text',
'maxlength' => 255,
'value' => $result['binary']
),
'fpmconfig' => array(
'visible' => \Froxlor\Settings::Get('phpfpm.enabled') == 1,
'label' => $lng['admin']['phpsettings']['fpmdesc'],
],
'fpmconfig' => [
'visible' => Settings::Get('phpfpm.enabled') == 1,
'label' => lng('admin.phpsettings.fpmdesc'),
'type' => 'select',
'select_var' => $fpmconfigs,
'selected' => $result['fpmsettingid']
),
'file_extensions' => array(
'visible' => \Froxlor\Settings::Get('system.mod_fcgid') == 1,
'label' => $lng['admin']['phpsettings']['file_extensions'],
'desc' => $lng['admin']['phpsettings']['file_extensions_note'],
],
'file_extensions' => [
'visible' => Settings::Get('system.mod_fcgid') == 1,
'label' => lng('admin.phpsettings.file_extensions'),
'desc' => lng('admin.phpsettings.file_extensions_note'),
'type' => 'text',
'maxlength' => 255,
'value' => $result['file_extensions']
),
'mod_fcgid_starter' => array(
'visible' => \Froxlor\Settings::Get('system.mod_fcgid') == 1,
'label' => $lng['admin']['mod_fcgid_starter']['title'],
],
'mod_fcgid_starter' => [
'visible' => Settings::Get('system.mod_fcgid') == 1,
'label' => lng('admin.mod_fcgid_starter.title'),
'type' => 'number',
'value' => ((int) $result['mod_fcgid_starter'] != -1 ? $result['mod_fcgid_starter'] : '')
),
'mod_fcgid_maxrequests' => array(
'visible' => \Froxlor\Settings::Get('system.mod_fcgid') == 1,
'label' => $lng['admin']['mod_fcgid_maxrequests']['title'],
'value' => ((int)$result['mod_fcgid_starter'] != -1 ? $result['mod_fcgid_starter'] : '')
],
'mod_fcgid_maxrequests' => [
'visible' => Settings::Get('system.mod_fcgid') == 1,
'label' => lng('admin.mod_fcgid_maxrequests.title'),
'type' => 'number',
'value' => ((int) $result['mod_fcgid_maxrequests'] != -1 ? $result['mod_fcgid_maxrequests'] : '')
),
'mod_fcgid_umask' => array(
'visible' => \Froxlor\Settings::Get('system.mod_fcgid') == 1,
'label' => $lng['admin']['mod_fcgid_umask']['title'],
'value' => ((int)$result['mod_fcgid_maxrequests'] != -1 ? $result['mod_fcgid_maxrequests'] : '')
],
'mod_fcgid_umask' => [
'visible' => Settings::Get('system.mod_fcgid') == 1,
'label' => lng('admin.mod_fcgid_umask.title'),
'type' => 'text',
'maxlength' => 3,
'value' => $result['mod_fcgid_umask']
),
'phpfpm_enable_slowlog' => array(
'visible' => \Froxlor\Settings::Get('phpfpm.enabled') == 1,
'label' => $lng['admin']['phpsettings']['enable_slowlog'],
],
'phpfpm_enable_slowlog' => [
'visible' => Settings::Get('phpfpm.enabled') == 1,
'label' => lng('admin.phpsettings.enable_slowlog'),
'type' => 'checkbox',
'value' => '1',
'checked' => $result['fpm_slowlog']
),
'phpfpm_reqtermtimeout' => array(
'visible' => \Froxlor\Settings::Get('phpfpm.enabled') == 1,
'label' => $lng['admin']['phpsettings']['request_terminate_timeout'],
],
'phpfpm_reqtermtimeout' => [
'visible' => Settings::Get('phpfpm.enabled') == 1,
'label' => lng('admin.phpsettings.request_terminate_timeout'),
'type' => 'text',
'maxlength' => 10,
'value' => $result['fpm_reqterm']
),
'phpfpm_reqslowtimeout' => array(
'visible' => \Froxlor\Settings::Get('phpfpm.enabled') == 1,
'label' => $lng['admin']['phpsettings']['request_slowlog_timeout'],
],
'phpfpm_reqslowtimeout' => [
'visible' => Settings::Get('phpfpm.enabled') == 1,
'label' => lng('admin.phpsettings.request_slowlog_timeout'),
'type' => 'text',
'maxlength' => 10,
'value' => $result['fpm_reqslow']
),
'phpfpm_pass_authorizationheader' => array(
'visible' => \Froxlor\Settings::Get('phpfpm.enabled') == 1,
'label' => $lng['admin']['phpsettings']['pass_authorizationheader'],
],
'phpfpm_pass_authorizationheader' => [
'visible' => Settings::Get('phpfpm.enabled') == 1,
'label' => lng('admin.phpsettings.pass_authorizationheader'),
'type' => 'checkbox',
'value' => '1',
'checked' => $result['pass_authorizationheader']
),
'override_fpmconfig' => array(
'label' => $lng['serversettings']['phpfpm_settings']['override_fpmconfig'],
],
'override_fpmconfig' => [
'label' => lng('serversettings.phpfpm_settings.override_fpmconfig'),
'type' => 'checkbox',
'value' => '1',
'checked' => $result['override_fpmconfig']
),
'pm' => array(
'visible' => \Froxlor\Settings::Get('phpfpm.enabled') == 1,
'label' => $lng['serversettings']['phpfpm_settings']['pm'],
'desc' => $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
],
'pm' => [
'visible' => Settings::Get('phpfpm.enabled') == 1,
'label' => lng('serversettings.phpfpm_settings.pm'),
'desc' => lng('serversettings.phpfpm_settings.override_fpmconfig_addinfo'),
'type' => 'select',
'select_var' => [
'static' => 'static',
@@ -116,72 +127,72 @@ return array(
'ondemand' => 'ondemand'
],
'selected' => $result['pm']
),
'max_children' => array(
'visible' => \Froxlor\Settings::Get('phpfpm.enabled') == 1,
'label' => $lng['serversettings']['phpfpm_settings']['max_children']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['max_children']['description'] . $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
],
'max_children' => [
'visible' => Settings::Get('phpfpm.enabled') == 1,
'label' => lng('serversettings.phpfpm_settings.max_children.title'),
'desc' => lng('serversettings.phpfpm_settings.max_children.description') . lng('serversettings.phpfpm_settings.override_fpmconfig_addinfo'),
'type' => 'number',
'value' => $result['max_children']
),
'start_servers' => array(
'visible' => \Froxlor\Settings::Get('phpfpm.enabled') == 1,
'label' => $lng['serversettings']['phpfpm_settings']['start_servers']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['start_servers']['description'] . $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
],
'start_servers' => [
'visible' => Settings::Get('phpfpm.enabled') == 1,
'label' => lng('serversettings.phpfpm_settings.start_servers.title'),
'desc' => lng('serversettings.phpfpm_settings.start_servers.description') . lng('serversettings.phpfpm_settings.override_fpmconfig_addinfo'),
'type' => 'number',
'value' => $result['start_servers']
),
'min_spare_servers' => array(
'visible' => \Froxlor\Settings::Get('phpfpm.enabled') == 1,
'label' => $lng['serversettings']['phpfpm_settings']['min_spare_servers']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['min_spare_servers']['description'] . $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
],
'min_spare_servers' => [
'visible' => Settings::Get('phpfpm.enabled') == 1,
'label' => lng('serversettings.phpfpm_settings.min_spare_servers.title'),
'desc' => lng('serversettings.phpfpm_settings.min_spare_servers.description') . lng('serversettings.phpfpm_settings.override_fpmconfig_addinfo'),
'type' => 'number',
'value' => $result['min_spare_servers']
),
'max_spare_servers' => array(
'visible' => \Froxlor\Settings::Get('phpfpm.enabled') == 1,
'label' => $lng['serversettings']['phpfpm_settings']['max_spare_servers']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['max_spare_servers']['description'] . $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
],
'max_spare_servers' => [
'visible' => Settings::Get('phpfpm.enabled') == 1,
'label' => lng('serversettings.phpfpm_settings.max_spare_servers.title'),
'desc' => lng('serversettings.phpfpm_settings.max_spare_servers.description') . lng('serversettings.phpfpm_settings.override_fpmconfig_addinfo'),
'type' => 'number',
'value' => $result['max_spare_servers']
),
'max_requests' => array(
'visible' => \Froxlor\Settings::Get('phpfpm.enabled') == 1,
'label' => $lng['serversettings']['phpfpm_settings']['max_requests']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['max_requests']['description'] . $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
],
'max_requests' => [
'visible' => Settings::Get('phpfpm.enabled') == 1,
'label' => lng('serversettings.phpfpm_settings.max_requests.title'),
'desc' => lng('serversettings.phpfpm_settings.max_requests.description') . lng('serversettings.phpfpm_settings.override_fpmconfig_addinfo'),
'type' => 'number',
'value' => $result['max_requests']
),
'idle_timeout' => array(
'visible' => \Froxlor\Settings::Get('phpfpm.enabled') == 1,
'label' => $lng['serversettings']['phpfpm_settings']['idle_timeout']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['idle_timeout']['description'] . $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
],
'idle_timeout' => [
'visible' => Settings::Get('phpfpm.enabled') == 1,
'label' => lng('serversettings.phpfpm_settings.idle_timeout.title'),
'desc' => lng('serversettings.phpfpm_settings.idle_timeout.description') . lng('serversettings.phpfpm_settings.override_fpmconfig_addinfo'),
'type' => 'number',
'value' => $result['idle_timeout']
),
'limit_extensions' => array(
'visible' => \Froxlor\Settings::Get('phpfpm.enabled') == 1,
'label' => $lng['serversettings']['phpfpm_settings']['limit_extensions']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['limit_extensions']['description'] . $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
],
'limit_extensions' => [
'visible' => Settings::Get('phpfpm.enabled') == 1,
'label' => lng('serversettings.phpfpm_settings.limit_extensions.title'),
'desc' => lng('serversettings.phpfpm_settings.limit_extensions.description') . lng('serversettings.phpfpm_settings.override_fpmconfig_addinfo'),
'type' => 'text',
'value' => $result['limit_extensions']
),
'phpsettings' => array(
'label' => $lng['admin']['phpsettings']['phpinisettings'],
],
'phpsettings' => [
'label' => lng('admin.phpsettings.phpinisettings'),
'type' => 'textarea',
'cols' => 80,
'rows' => 20,
'value' => $result['phpsettings']
),
'allow_all_customers' => array(
'label' => $lng['serversettings']['phpfpm_settings']['allow_all_customers']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['allow_all_customers']['description'],
],
'allow_all_customers' => [
'label' => lng('serversettings.phpfpm_settings.allow_all_customers.title'),
'desc' => lng('serversettings.phpfpm_settings.allow_all_customers.description'),
'type' => 'checkbox',
'value' => '1',
'checked' => false
)
)
)
)
)
);
]
]
]
]
]
];