php/docker/usr/local/bin/xdebug_enable

36 lines
812 B
Plaintext
Raw Normal View History

2021-10-13 16:40:48 +00:00
#!/bin/bash
#
# Helper functions
#
declare -i term_width=80
h1() {
declare border padding text
border='\e[1;34m'"$(printf '=%.0s' $(seq 1 "$term_width"))"'\e[0m'
padding="$(printf ' %.0s' $(seq 1 $(((term_width - $(wc -m <<<"$*")) / 2))))"
text="\\e[1m$*\\e[0m"
echo -e "$border"
echo -e "${padding}${text}${padding}"
echo -e "$border"
}
h2() {
printf '\e[1;33m==>\e[37;1m %s\e[0m\n' "$*"
}
h1 "Actual environment: ${ENVIRONMENT}"
2021-11-23 02:08:41 +00:00
if [[ $ENVIRONMENT != 'production' ]]; then
2021-10-13 16:40:48 +00:00
wget -O phpunit https://phar.phpunit.de/phpunit-9.phar
install phpunit /usr/local/bin
fi
2021-11-23 02:08:41 +00:00
if [[ $ENVIRONMENT == 'development' ]]; then
2021-10-13 16:40:48 +00:00
h2 "Install xdebug"
apk --update --no-cache add autoconf g++ make
pecl install -f xdebug
docker-php-ext-enable xdebug
apk del --purge autoconf g++ make
fi