Browse Source

improve setup scripts

Hamilton Turner 10 years ago
parent
commit
fcd286ea9a
2 changed files with 17 additions and 5 deletions
  1. 9 1
      frameworks/PHP/php-symfony2/install.sh
  2. 8 4
      frameworks/PHP/php-symfony2/setup.sh

+ 9 - 1
frameworks/PHP/php-symfony2/install.sh

@@ -1,3 +1,11 @@
 #!/bin/bash
 
-fw_depends php composer nginx
+fw_depends php nginx composer
+
+export PHP_HOME=${IROOT}/php-5.5.17
+export PHP_FPM=$PHP_HOME/sbin/php-fpm
+export NGINX_HOME=${IROOT}/nginx
+
+${PHP_HOME}/bin/php $IROOT/composer.phar install \
+  --no-interaction --working-dir $TROOT \
+  --no-progress --optimize-autoloader 

+ 8 - 4
frameworks/PHP/php-symfony2/setup.sh

@@ -4,10 +4,14 @@ sed -i 's|database_host: .*|database_host: '"${DBHOST}"'|g' app/config/parameter
 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"
+export PHP_HOME=${IROOT}/php-5.5.17
+export PHP_FPM=$PHP_HOME/sbin/php-fpm
+export NGINX_HOME=${IROOT}/nginx
+
+${PHP_HOME}/bin/php app/console cache:clear \
+  --env=prod --no-debug
+${PHP_HOME}/bin/php app/console cache:warmup \
+  --env=prod --no-debug
 
-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