From a204303e5099dcb88e5e4760a09e7de9a96c4ea3 Mon Sep 17 00:00:00 2001 From: Florian Schaal <florian@schaal-24.de> Date: Fri, 17 Oct 2014 08:05:51 -0400 Subject: [PATCH] moved "function send_notification_email" from 300-quota_notify.inc.php to monitor_tools.inc.php --- server/plugins-available/nginx_plugin.inc.php | 27 ++++++++++++++++++++++++++- 1 files changed, 26 insertions(+), 1 deletions(-) diff --git a/server/plugins-available/nginx_plugin.inc.php b/server/plugins-available/nginx_plugin.inc.php index 0512041..3c84517 100644 --- a/server/plugins-available/nginx_plugin.inc.php +++ b/server/plugins-available/nginx_plugin.inc.php @@ -708,7 +708,7 @@ if($web_config['security_level'] == 20) { $app->system->chmod($data['new']['document_root'], 0755); - $app->system->chmod($data['new']['document_root'].'/web', 0711); + $app->system->chmod($data['new']['document_root'].'/web', 0751); //$app->system->chmod($data['new']['document_root'].'/webdav',0710); $app->system->chmod($data['new']['document_root'].'/private', 0710); $app->system->chmod($data['new']['document_root'].'/ssl', 0755); @@ -1644,6 +1644,7 @@ } $this->php_fpm_pool_update($data, $web_config, $pool_dir, $pool_name, $socket_dir); + $this->hhvm_update($data, $web_config); if($web_config['check_apache_config'] == 'y') { //* Test if nginx starts with the new configuration file @@ -1954,6 +1955,8 @@ // remove PHP-FPM pool if ($data['old']['php'] == 'php-fpm') { $this->php_fpm_pool_delete($data, $web_config); + } elseif($data['old']['php'] == 'hhvm') { + $this->hhvm_update($data, $web_config); } //remove the php cgi starter script if available @@ -2301,6 +2304,28 @@ } } + private function hhvm_update($data, $web_config) { + global $app, $conf; + + if(file_exists($conf['rootpath'] . '/conf-custom/hhvm_starter.master')) { + $content = file_get_contents($conf['rootpath'] . '/conf-custom/hhvm_starter.master'); + } else { + $content = file_get_contents($conf['rootpath'] . '/conf/hhvm_starter.master'); + } + + if($data['new']['php'] == 'hhvm' && $data['old']['php'] != 'hhvm') { + $content = str_replace('{SYSTEM_USER}', $data['new']['system_user'], $content); + file_put_contents('/etc/init.d/hhvm_' . $data['new']['system_user'], $content); + exec('chmod +x /etc/init.d/hhvm_' . $data['new']['system_user'] . ' >/dev/null 2>&1'); + exec('/usr/sbin/update-rc.d hhvm_' . $data['new']['system_user'] . ' defaults >/dev/null 2>&1'); + exec('/etc/init.d/hhvm_' . $data['new']['system_user'] . ' start >/dev/null 2>&1'); + } elseif($data['new']['php'] != 'hhvm' && $data['old']['php'] == 'hhvm') { + exec('/etc/init.d/hhvm_' . $data['old']['system_user'] . ' stop >/dev/null 2>&1'); + exec('/usr/sbin/update-rc.d hhvm_' . $data['old']['system_user'] . ' remove >/dev/null 2>&1'); + unlink('/etc/init.d/hhvm_' . $data['old']['system_user'] . ' >/dev/null 2>&1'); + } + } + //* Update the PHP-FPM pool configuration file private function php_fpm_pool_update ($data, $web_config, $pool_dir, $pool_name, $socket_dir) { global $app, $conf; -- Gitblit v1.9.1