From 1c6da3502e13ca5391b5ece1349b8401876e4b99 Mon Sep 17 00:00:00 2001
From: Marius Cramer <m.cramer@pixcept.de>
Date: Wed, 30 Apr 2014 05:26:30 -0400
Subject: [PATCH] Implemented: FS#3266 - HHVM PHP mode support (some improvements, nginx support)

---
 server/plugins-available/apache2_plugin.inc.php |   16 +---------------
 1 files changed, 1 insertions(+), 15 deletions(-)

diff --git a/server/plugins-available/apache2_plugin.inc.php b/server/plugins-available/apache2_plugin.inc.php
index 8af0500..f1a08af 100644
--- a/server/plugins-available/apache2_plugin.inc.php
+++ b/server/plugins-available/apache2_plugin.inc.php
@@ -2738,23 +2738,9 @@
 		} else {
 			$content = file_get_contents($conf['rootpath'] . '/conf/hhvm_starter.master');
 		}
-		$start_content = '';
-		$stop_content = '';
 		
 		if($data['new']['php'] == 'hhvm' && $data['old']['php'] != 'hhvm') {
-			$start_content .= 'if [ ! -d /var/run/hhvm ]; then
-        mkdir -p -m0777 /var/run/hhvm
-        else
-        chmod 777 /var/run/hhvm
-    fi
-	umask 017
-    sudo -u ' . $data['new']['system_user'] . ' touch /var/run/hhvm/hhvm_' . $data['new']['system_user'] . '.pid
-    /usr/bin/hhvm --mode daemon -vServer.Type=fastcgi --user ' . $data['new']['system_user'] . ' -vServer.FileSocket=/tmp/hhvm.' . $data['new']['system_user'] . '.sock -vLog.Level=Warning -vLog.UseLogFile=false -vRepo.Central.Path=/tmp/hhvm.' . $data['new']['system_user'] . '.hhbc -vPidFile=/var/run/hhvm/hhvm_' . $data['new']['system_user'] . '.pid & echo $! > /var/run/hhvm/hhvm_' . $data['new']['system_user'] . '.pid';
-			
-			$stop_content .= 'if [[ -e "/var/run/hhvm/hhvm_' . $data['new']['system_user'] . '.pid" ]] ; then kill -SIGTERM `cat /var/run/hhvm/hhvm_' . $data['new']['system_user'] . '.pid` >/dev/null 2>&1 ; fi
-	rm -f /tmp/hhvm.' . $data['new']['system_user'] . '.sock /tmp/hhvm.' . $data['new']['system_user'] . '.hhbc /var/run/hhvm/hhvm_' . $data['new']['system_user'] . '.pid';
-		
-			$content = str_replace(array('{START}', '{STOP}', '{SYSTEM_USER}'), array($start_content, $stop_content, $data['new']['system_user']), $content);
+			$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');

--
Gitblit v1.9.1