Browse Source

Convert setup.py to setup.sh for php-symfony2

All tests fail, due to an expectation of ApcClassLoader when APC is not
enabled. A recent commit has the title "update symfony2 with Redis instead
of APC", suspect that is the source of the issue
Lita Gratrix 10 years ago
parent
commit
c6d25304c1

+ 1 - 1
frameworks/PHP/php-symfony2/bash_profile.sh

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

+ 0 - 26
frameworks/PHP/php-symfony2/setup.py

@@ -1,26 +0,0 @@
-import subprocess
-import sys
-import setup_util
-
-def start(args, logfile, errfile):
-  setup_util.replace_text("php-symfony2/app/config/parameters.yml", "database_host: .*", "database_host: " + args.database_host)
-  setup_util.replace_text("php-symfony2/deploy/nginx.conf", "root .*\/FrameworkBenchmarks/php-symfony2", "root " + args.troot)
-
-  try:
-    subprocess.check_call("composer.phar install --optimize-autoloader", shell=True, cwd="php-symfony2", stderr=errfile, stdout=logfile)
-    subprocess.check_call("php app/console cache:clear --env=prod --no-debug", shell=True, cwd="php-symfony2", stderr=errfile, stdout=logfile)
-    subprocess.check_call("php app/console cache:warmup --env=prod --no-debug", shell=True, cwd="php-symfony2", stderr=errfile, stdout=logfile)
-    subprocess.check_call("sudo chown -R www-data:www-data php-symfony2", shell=True, stderr=errfile, stdout=logfile)
-    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:
-    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 chown -R $USER:$USER php-symfony2", shell=True, stderr=errfile, stdout=logfile)
-    return 0
-  except subprocess.CalledProcessError:
-    return 1

+ 13 - 0
frameworks/PHP/php-symfony2/setup.sh

@@ -0,0 +1,13 @@
+#!/bin/bash
+
+sed -i 's|database_host: .*|database_host: '"${DBHOST}"'|g' app/config/parameters.yml
+sed -i 's|root .*/FrameworkBenchmarks/php-symfony2| root '"${TROOT}"'|g' deploy/nginx.conf
+sed -i 's|/usr/local/nginx/|'"${IROOT}"'/nginx/|g' deploy/nginx.conf
+
+export PATH="$COMPOSER_HOME:$PHP_HOME/bin:$PHP_HOME/sbin:$PATH"
+
+composer.phar install --optimize-autoloader
+php app/console cache:clear --env=prod --no-debug
+php app/console cache:warmup --env=prod --no-debug
+$PHP_FPM --fpm-config $FWROOT/config/php-fpm.conf -g $TROOT/deploy/php-fpm.pid
+$NGINX_HOME/sbin/nginx -c $TROOT/deploy/nginx.conf