From 5e0575ac21deccf4d1a4b88d4273898997d75092 Mon Sep 17 00:00:00 2001 From: Ronald Ip Date: Fri, 20 Jul 2012 04:05:12 +0000 Subject: [PATCH 1/3] PHP v5.4.5. --- bin/compile | 2 +- support/ec2-build-php.sh | 2 +- support/set-env.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/compile b/bin/compile index 91deccfa6..300cc939b 100755 --- a/bin/compile +++ b/bin/compile @@ -8,7 +8,7 @@ set -o pipefail NGINX_VERSION=1.2.2 LIBMCRYPT_VERSION=2.5.8 LIBMEMCACHED_VERSION=1.0.7 -PHP_VERSION=5.4.4 +PHP_VERSION=5.4.5 NEWRELIC_VERSION=2.9.5.78 S3_BUCKET=heroku-buildpack-php-tyler # END CONFIG diff --git a/support/ec2-build-php.sh b/support/ec2-build-php.sh index 6dc5ba76b..a8e5c7ceb 100644 --- a/support/ec2-build-php.sh +++ b/support/ec2-build-php.sh @@ -5,7 +5,7 @@ ## EDIT export S3_BUCKET="heroku-buildpack-php-tyler" export LIBMCRYPT_VERSION="2.5.8" -export PHP_VERSION="5.4.4" +export PHP_VERSION="5.4.5" export APC_VERSION="3.1.10" export PHPREDIS_VERSION="2.2.1" export LIBMEMCACHED_VERSION="1.0.7" diff --git a/support/set-env.sh b/support/set-env.sh index fc7c43d61..9feb818c7 100755 --- a/support/set-env.sh +++ b/support/set-env.sh @@ -1,7 +1,7 @@ #!/bin/bash export NGINX_VERSION="1.2.2" -export PHP_VERSION="5.4.4" +export PHP_VERSION="5.4.5" export LIBMCRYPT_VERSION="2.5.8" export LIBMEMCACHED_VERSION="1.0.7" export NEWRELIC_VERSION="2.9.5.78" From 09a26592ad85e5f6732ab00ee35ae3d497be9485 Mon Sep 17 00:00:00 2001 From: Ronald Ip Date: Fri, 20 Jul 2012 06:51:14 +0000 Subject: [PATCH 2/3] Use $CACHE_DIR for composer cache. --- bin/compile | 5 +++-- test/compile_test.sh | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/bin/compile b/bin/compile index 300cc939b..9106976fc 100755 --- a/bin/compile +++ b/bin/compile @@ -53,11 +53,12 @@ BUILD_DIR=$1 CACHE_DIR=$2 BUNDLE_DIR="${CACHE_DIR}/bundles" LP_DIR=`cd $(dirname $0); cd ..; pwd` +export COMPOSER_HOME="${CACHE_DIR}/.composer" # include .files when moving things around shopt -s dotglob -mkdir -p $BUILD_DIR $CACHE_DIR ${BUNDLE_DIR} ${BUILD_DIR}/local ${BUILD_DIR}/vendor/bin +mkdir -p $BUILD_DIR $CACHE_DIR ${BUNDLE_DIR} ${BUILD_DIR}/local ${BUILD_DIR}/vendor/bin ${COMPOSER_HOME} echo "-----> Fetching Manifest" pushd ${BUNDLE_DIR} > /dev/null @@ -180,7 +181,7 @@ then # do the deed! echo "Running: php composer.phar install" | indent - LD_LIBRARY_PATH="${BUILD_DIR}/local/lib" ${BUILD_DIR}/vendor/php/bin/php composer.phar install | indent + LD_LIBRARY_PATH="${BUILD_DIR}/local/lib" ${BUILD_DIR}/vendor/php/bin/php composer.phar install -n | indent export GIT_DIR=$GIT_DIR_ORIG fi diff --git a/test/compile_test.sh b/test/compile_test.sh index d8a9923de..1aa3b9e90 100644 --- a/test/compile_test.sh +++ b/test/compile_test.sh @@ -92,4 +92,6 @@ EOF assertCaptured "Running: php composer.phar install" assertCaptured "packforlan/packtest" assertTrue "packforlan/packtest package exists" "[ -f ${BUILD_DIR}/vendor/packforlan/packtest/composer.json ]" + + assertTrue "composer cache exists in cache dir" "[ -d ${CACHE_DIR}/.composer/cache ]" } From e64c2e4198fd2a6abcdb0325f72c1b9d1c40a02e Mon Sep 17 00:00:00 2001 From: Ronald Ip Date: Fri, 20 Jul 2012 07:10:34 +0000 Subject: [PATCH 3/3] Now able to detect index.php nested in another directory. This is useful for cases where the web-root is a sub-directory. --- bin/detect | 2 +- test/detect_test.sh | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/bin/detect b/bin/detect index b3455f221..5f3204545 100755 --- a/bin/detect +++ b/bin/detect @@ -1,6 +1,6 @@ #!/usr/bin/env bash -if [ -f $1/index.php ]; then +if [ `find "$1" -type f -iname "index.php" 2> /dev/null | wc -l` -ge 1 ]; then echo "PHP" && exit 0 else echo "no" && exit 1 diff --git a/test/detect_test.sh b/test/detect_test.sh index ff0e8a1a1..3b7b42fa9 100644 --- a/test/detect_test.sh +++ b/test/detect_test.sh @@ -13,6 +13,17 @@ testDetect() assertAppDetected "PHP" } +testDeepDetect() +{ + mkdir -p ${BUILD_DIR}/public_html + touch ${BUILD_DIR}/public_html/index.php + + detect + + assertCapturedSuccess + assertAppDetected "PHP" +} + testNoDetectPHP() { mkdir -p ${BUILD_DIR}/