Browse Source

Started PHP and fixed a Scala

Mike Smith 10 years ago
parent
commit
f1220cd6b3

+ 1 - 1
frameworks/PHP/cakephp/bash_profile.sh

@@ -4,4 +4,4 @@ export PHP_HOME=${IROOT}/php-5.5.17
 
 export PHP_FPM=$PHP_HOME/sbin/php-fpm
 
-export PATH="$PHP_HOME/bin:$PHP_HOME/sbin:$PATH"
+export NGINX_HOME=${IROOT}/nginx

+ 0 - 47
frameworks/PHP/cakephp/setup.py

@@ -1,47 +0,0 @@
-
-import subprocess
-import sys
-import os
-import setup_util
-from os.path import expanduser
-
-def start(args, logfile, errfile):
-  fwroot = args.fwroot
-  setup_util.replace_text("cakephp/app/Config/database.php", "'host' => '.*',", "'host' => '" + args.database_host + "',")
-  setup_util.replace_text("cakephp/app/Config/core.php", "'REDISSERVER'", "'" + args.database_host + "'")
-  setup_util.replace_text("cakephp/deploy/cake", "\".*\/FrameworkBenchmarks/cakephp", "\"%s" % args.troot)
-  setup_util.replace_text("cakephp/deploy/cake", "Directory .*\/FrameworkBenchmarks/cakephp", "Directory %s" % args.troot)
-  setup_util.replace_text("cakephp/deploy/nginx.conf", "root .*\/FrameworkBenchmarks/cakephp", "root %s" % args.troot)
-
-  try:
-    if os.name == 'nt':
-      setup_util.replace_text("cakephp/app/Config/core.php", "'Redis'", "'Wincache'")
-      subprocess.check_call('icacls "C:\\FrameworkBenchmarks\\cakephp" /grant "IIS_IUSRS:(OI)(CI)F"', shell=True, stderr=errfile, stdout=logfile)
-      subprocess.check_call('appcmd add site /name:PHP /bindings:http/*:8080: /physicalPath:"C:\\FrameworkBenchmarks\\cakephp\\app\\webroot"', shell=True, stderr=errfile, stdout=logfile)
-      return 0
-    #subprocess.check_call("sudo cp cake/deploy/cake /etc/apache2/sites-available/", shell=True)
-    #subprocess.check_call("sudo a2ensite cake", shell=True)
-    subprocess.check_call("sudo chown -R www-data:www-data cakephp", shell=True, stderr=errfile, stdout=logfile)
-    
-    # Sudo needed to switch to correct user
-    #   This is a bit tricky as sudo normally resets the PATH for security
-    #   To work around that in this one case, we use the full 
-    #   path to the php-fpm binary we setup in bash_profile.sh
-    subprocess.check_call("sudo $PHP_FPM --fpm-config $FWROOT/config/php-fpm.conf -g $TROOT/deploy/php-fpm.pid", shell=True, stderr=errfile, stdout=logfile)
-    subprocess.check_call("sudo /usr/local/nginx/sbin/nginx -c $TROOT/deploy/nginx.conf", shell=True, stderr=errfile, stdout=logfile)
-    return 0
-  except subprocess.CalledProcessError:
-    return 1
-def stop(logfile, errfile):
-  try:
-    if os.name == 'nt':
-      subprocess.call('appcmd delete site PHP', shell=True, stderr=errfile, stdout=logfile)
-      return 0
-    subprocess.call("sudo /usr/local/nginx/sbin/nginx -s stop", shell=True, stderr=errfile, stdout=logfile)
-    subprocess.call("sudo kill -QUIT $( cat $TROOT/deploy/php-fpm.pid )", shell=True, stderr=errfile, stdout=logfile)
-    #subprocess.check_call("sudo a2dissite cake", shell=True)
-    #subprocess.check_call("sudo /etc/init.d/apache2 stop", shell=True)
-    subprocess.check_call("sudo chown -R $USER:$USER cakephp", shell=True, stderr=errfile, stdout=logfile)
-    return 0
-  except subprocess.CalledProcessError:
-    return 1

+ 11 - 0
frameworks/PHP/cakephp/setup.sh

@@ -0,0 +1,11 @@
+#!/bin/bash
+
+sed -i "s|'host' => '.*'|'host' => '\"{DBHOST}\"'|g" app/Config/database.php
+sed -i 's|REDISSERVER|'"${DBHOST}"'|g' app/Config/core.php
+sed -i 's|".*/FrameworkBenchmarks/cakephp|"'"${TROOT}"'|g' deploy/cake
+sed -i 's|Directory .*/FrameworkBenchmarks/cakephp|Directory '"${TROOT}"'|g' deploy/cake
+sed -i 's|root .*/FrameworkBenchmarks/cakephp|root '"${TROOT}"'|g' deploy/nginx.conf
+
+$PHP_FPM --fpm-config $FWROOT/config/php-fpm.conf -g $TROOT/deploy/php-fpm.pid
+
+$NGINX_HOME/sbin/nginx -c $TROOT/deploy/nginx.conf

+ 1 - 1
frameworks/PHP/hhvm/benchmark_config

@@ -3,7 +3,7 @@
   "tests":
     [{
         "raw": {
-              "setup_file"     : "setup",
+              "setup_file"     : "setup_hhvm",
               "json_url"       : "/json",
               "db_url"         : "/db",
               "query_url"      : "/queries?queries=",

+ 1 - 1
frameworks/PHP/hhvm/deploy/config.hdf

@@ -15,7 +15,7 @@ Log {
   UseLogFile = false
   UseSyslog = false
   Level = Error
-  File = /tmp/FrameworkBenchmarks/hhvm/error.log
+  #File = /tmp/FrameworkBenchmarks/hhvm/error.log
 }
 
 # Enable jit for production mode

+ 9 - 0
frameworks/PHP/hhvm/setup_hhvm.sh

@@ -0,0 +1,9 @@
+#!/bin/bash
+
+sed -i 's|host=localhost;|host='"${DBHOST}"';|g' once.php.inc
+sed -i 's|SourceRoot = .*/FrameworkBenchmarks/hhvm|SourceRoot = '"${TROOT}"'|g' deploy/config.hdf
+sed -i 's|Path = .*/.hhvm.hhbc|Path = '"${TROOT}"'/.hhvm.bbhc|g' deploy/config.hdf
+sed -i 's|PidFile = .*/hhvm.pid|PidFile = '"${TROOT}"'/hhvm.pid|g' deploy/config.hdf
+sed -i 's|File = .*/error.log|File = '"${TROOT}"'/error.log|g' deploy/config.hdf
+
+hhvm --config $TROOT/deploy/config.hdf -m daemon

+ 1 - 1
frameworks/Scala/lift-stateless/setup.sh

@@ -1,6 +1,6 @@
 #!/bin/bash
 
-sed -i 's|> ".*:3306|> ":'"${DBHOST}"'3306|g' src/main/scala/Main.scala
+sed -i 's|> ".*:3306|> "'"${DBHOST}"':3306|g' src/main/scala/Main.scala
 
 ${SBT_HOME}/bin/sbt update assembly
 

+ 2 - 2
toolset/setup/linux/languages/hhvm.sh

@@ -1,6 +1,6 @@
 #!/bin/bash
 
-RETCODE=$(fw_exists hhvm.installed)
+RETCODE=$(fw_exists ${IROOT}/hhvm.installed)
 [ ! "$RETCODE" == 0 ] || { return 0; }
 
 sudo add-apt-repository -y ppa:mapnik/v2.2.0
@@ -9,4 +9,4 @@ echo deb http://dl.hhvm.com/ubuntu `lsb_release -sc` main | sudo tee /etc/apt/so
 sudo apt-get update
 sudo apt-get install -y hhvm
 
-touch hhvm.installed
+touch ${IROOT}/hhvm.installed

+ 1 - 1
toolset/setup/linux/languages/php.sh

@@ -4,7 +4,7 @@
 # Two path checks would both always run in php. In this code the check 
 # for apc.so only happens if the check for php fails. Is that ok? 
 
-RETCODE=$(fw_exists php.installed)
+RETCODE=$(fw_exists ${IROOT}/php.installed)
 [ ! "$RETCODE" == 0 ] || { \
   echo "Moving PHP config files into place"; 
   sudo cp $FWROOT/config/php.ini /usr/local/lib/php.ini