@@ -1644,6 +1644,7 @@ function update($event_name, $data) {
16441644 }
16451645
16461646 $ this ->php_fpm_pool_update ($ data , $ web_config , $ pool_dir , $ pool_name , $ socket_dir );
1647+ $ this ->hhvm_update ($ data , $ web_config );
16471648
16481649 if ($ web_config ['check_apache_config ' ] == 'y ' ) {
16491650 //* Test if nginx starts with the new configuration file
@@ -1954,6 +1955,8 @@ function delete($event_name, $data) {
19541955 // remove PHP-FPM pool
19551956 if ($ data ['old ' ]['php ' ] == 'php-fpm ' ) {
19561957 $ this ->php_fpm_pool_delete ($ data , $ web_config );
1958+ } elseif ($ data ['old ' ]['php ' ] == 'hhvm ' ) {
1959+ $ this ->hhvm_update ($ data , $ web_config );
19571960 }
19581961
19591962 //remove the php cgi starter script if available
@@ -2301,6 +2304,28 @@ private function awstats_delete ($data, $web_config) {
23012304 }
23022305 }
23032306
2307+ private function hhvm_update ($ data , $ web_config ) {
2308+ global $ app , $ conf ;
2309+
2310+ if (file_exists ($ conf ['rootpath ' ] . '/conf-custom/hhvm_starter.master ' )) {
2311+ $ content = file_get_contents ($ conf ['rootpath ' ] . '/conf-custom/hhvm_starter.master ' );
2312+ } else {
2313+ $ content = file_get_contents ($ conf ['rootpath ' ] . '/conf/hhvm_starter.master ' );
2314+ }
2315+
2316+ if ($ data ['new ' ]['php ' ] == 'hhvm ' && $ data ['old ' ]['php ' ] != 'hhvm ' ) {
2317+ $ content = str_replace ('{SYSTEM_USER} ' , $ data ['new ' ]['system_user ' ], $ content );
2318+ file_put_contents ('/etc/init.d/hhvm_ ' . $ data ['new ' ]['system_user ' ], $ content );
2319+ exec ('chmod +x /etc/init.d/hhvm_ ' . $ data ['new ' ]['system_user ' ] . ' >/dev/null 2>&1 ' );
2320+ exec ('/usr/sbin/update-rc.d hhvm_ ' . $ data ['new ' ]['system_user ' ] . ' defaults >/dev/null 2>&1 ' );
2321+ exec ('/etc/init.d/hhvm_ ' . $ data ['new ' ]['system_user ' ] . ' start >/dev/null 2>&1 ' );
2322+ } elseif ($ data ['new ' ]['php ' ] != 'hhvm ' && $ data ['old ' ]['php ' ] == 'hhvm ' ) {
2323+ exec ('/etc/init.d/hhvm_ ' . $ data ['old ' ]['system_user ' ] . ' stop >/dev/null 2>&1 ' );
2324+ exec ('/usr/sbin/update-rc.d hhvm_ ' . $ data ['old ' ]['system_user ' ] . ' remove >/dev/null 2>&1 ' );
2325+ unlink ('/etc/init.d/hhvm_ ' . $ data ['old ' ]['system_user ' ] . ' >/dev/null 2>&1 ' );
2326+ }
2327+ }
2328+
23042329 //* Update the PHP-FPM pool configuration file
23052330 private function php_fpm_pool_update ($ data , $ web_config , $ pool_dir , $ pool_name , $ socket_dir ) {
23062331 global $ app , $ conf ;
0 commit comments