php/docker/usr/local/bin/php_helper.sh
Aleksander Cynarski 54ff499e2d
All checks were successful
continuous-integration/drone/push Build is passing
php override, normalize path, php_helper
2021-04-05 16:01:36 +02:00

29 lines
668 B
Bash
Executable File

#!/bin/sh
PHP_VERSION=`php -r 'echo PHP_MAJOR_VERSION.PHP_MINOR_VERSION;'`
if [ -f /usr/local/etc/php/php.ini-$ENVIRONMENT ]; then
mv /usr/local/etc/php/php.ini-$ENVIRONMENT /usr/local/etc/php/php.ini
fi
if [ $PHP_VERSION = '72' ]; then
wget -O /bin/composer https://getcomposer.org/composer-1.phar
else
wget -O /bin/composer https://getcomposer.org/composer.phar
fi
chmod a+x /bin/composer
if [ $PHP_VERSION = '72' ]; then
composer global require hirak/prestissimo
fi
if [ $ENVIRONMENT = 'development' ]; then
apk --update --no-cache add autoconf g++ make
pecl install -f xdebug
docker-php-ext-enable xdebug
apk del --purge autoconf g++ make
fi