Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Composer installation support #10

Closed
wants to merge 17 commits into from
15 changes: 15 additions & 0 deletions bin/compile
Expand Up @@ -46,6 +46,21 @@ cp $LP_DIR/conf/php.ini php
mkdir -p bin mkdir -p bin
ln -s /app/php/bin/php bin/php ln -s /app/php/bin/php bin/php


# check if we have Composer dependencies and vendors are not bundled
if [ -f www/composer.json ] && [ ! -d www/vendor ]; then
GIT_DIR_ORIG=$GIT_DIR
unset GIT_DIR
echo "-----> Installing Composer dependencies"
COMPOSER_URL="http://getcomposer.org/composer.phar"
curl --silent --max-time 60 --location "$COMPOSER_URL" > www/composer.phar
cd www
LD_LIBRARY_PATH=$BUILD_DIR/php/ext $BUILD_DIR/php/bin/php -c $LP_DIR/conf/php.ini composer.phar install --prefer-source
rm -rf vendor/**/.git
cd $BUILD_DIR
rm www/composer.phar
export GIT_DIR=$GIT_DIR_ORIG
fi

cat >>boot.sh <<EOF cat >>boot.sh <<EOF
for var in \`env|cut -f1 -d=\`; do for var in \`env|cut -f1 -d=\`; do
echo "PassEnv \$var" >> /app/apache/conf/httpd.conf; echo "PassEnv \$var" >> /app/apache/conf/httpd.conf;
Expand Down