Skip to content

Commit 9664e7f

Browse files
author
Marius Cramer
committed
Merge branch 'default_php_handler' into 'master'
Default php handler I added a default php handler setting for server. I want to use PHP-FPM for hostings, so I only enable PHP-FPM on client templates. However, when admin create hosting must remember to change php handler becuase default is FastCGI. With this patch, default php for default server is set.
2 parents 8a4a1fa + 3245aa9 commit 9664e7f

File tree

5 files changed

+25
-2
lines changed

5 files changed

+25
-2
lines changed

interface/web/admin/form/server_config.tform.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -880,6 +880,13 @@
880880
'width' => '10',
881881
'maxlength' => '255'
882882
),
883+
'php_handler' => array(
884+
'datatype' => 'VARCHAR',
885+
'formtype' => 'SELECT',
886+
'default' => 'fast-cgi',
887+
'value' => array('no' => 'disabled_txt', 'fast-cgi' => 'Fast-CGI', 'cgi' => 'CGI', 'mod' => 'Mod-PHP', 'suphp' => 'SuPHP', 'php-fpm' => 'PHP-FPM'),
888+
'searchable' => 2
889+
),
883890
'nginx_cgi_socket' => array(
884891
'datatype' => 'VARCHAR',
885892
'formtype' => 'TEXT',

interface/web/admin/lib/lang/en_server_config.lng

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,4 +200,6 @@ $wb['backup_delete_txt'] = 'Delete backups on domain/website delete';
200200
$wb["overquota_db_notify_admin_txt"] = 'Send DB quota warnings to admin';
201201
$wb["overquota_db_notify_client_txt"] = 'Send DB quota warnings to client';
202202
$wb['monitor_system_updates_txt'] = 'Check for Linux updates';
203+
$wb['php_handler_txt'] = "PHP Handler";
204+
$wb['disabled_txt'] = 'Disabled';
203205
?>

interface/web/admin/lib/lang/es_server_config.lng

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,4 +192,6 @@ $wb['munin_url_note_txt'] = 'Marcadores:';
192192
$wb['backup_dir_is_mount_txt'] = '¿El directorio de copias de seguridad es un punto de montaje?';
193193
$wb['backup_dir_mount_cmd_txt'] = 'Comando para montar, si el directorio de copias de seguridad no está montado';
194194
$wb['monitor_system_updates_txt'] = 'Comprobar actualizaciones de linux';
195+
$wb['php_handler_txt'] = "Manejador de PHP";
196+
$wb['disabled_txt'] = "Desactivado";
195197
?>

interface/web/admin/templates/server_config_web_edit.htm

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,14 @@ <h2><tmpl_var name="list_head_txt"></h2>
233233
<label for="php_ini_check_minutes">{tmpl_var name='php_ini_check_minutes_txt'}</label>
234234
<input name="php_ini_check_minutes" id="php_ini_check_minutes" value="{tmpl_var name='php_ini_check_minutes'}" size="40" type="text" class="textInput" /> {tmpl_var name='php_ini_check_minutes_info_txt'}
235235
</div>
236+
<div class="ctrlHolder">
237+
<label for="php_handler">{tmpl_var name='php_handler_txt'}</label>
238+
<div class="multiField">
239+
<select name="php_handler" id="php_handler" class="selectInput">
240+
{tmpl_var name='php_handler'}
241+
</select>
242+
</div>
243+
</div>
236244
</div>
237245
<div class="subsectiontoggle"><span></span>{tmpl_var name='apps_vhost_settings_txt'}<em></em></div>
238246
<div style="display:none;">

interface/web/sites/web_vhost_domain_edit.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,16 @@ function onShowNew() {
113113
$client_group_id = $_SESSION["s"]["user"]["default_group"];
114114
$client = $app->db->queryOneRecord("SELECT client.web_servers FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id");
115115
$web_servers = explode(',', $client['web_servers']);
116-
$app->tpl->setVar("server_id_value", $web_servers[0]);
116+
$server_id = $web_servers[0];
117+
$app->tpl->setVar("server_id_value", $server_id);
117118
unset($web_servers);
118119
} else {
119120
$settings = $app->getconf->get_global_config('sites');
120-
$app->tform->formDef['tabs']['domain']['fields']['server_id']['default'] = intval($settings['default_webserver']);
121+
$server_id = intval($settings['default_webserver']);
122+
$app->tform->formDef['tabs']['domain']['fields']['server_id']['default'] = $server_id;
121123
}
124+
$web_config = $app->getconf->get_server_config($server_id, 'web');
125+
$app->tform->formDef['tabs']['domain']['fields']['php']['default'] = $web_config['php_handler'];
122126
$app->tform->formDef['tabs']['domain']['readonly'] = false;
123127

124128
$app->tpl->setVar('vhostdomain_type', $this->_vhostdomain_type);

0 commit comments

Comments
 (0)