Aleksander Cynarski
6928a5ecc5
Some checks failed
continuous-integration/drone/push Build is failing
57 lines
1.4 KiB
Bash
Executable File
57 lines
1.4 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
PHP_VERSION=`php -r 'echo PHP_MAJOR_VERSION.PHP_MINOR_VERSION;'`
|
|
PHP_MODULES=("calendar" "bcmath" "bz2" "curl" "fileinfo" "gd" "gettext" "iconv" "imap" "intl" "ldap" "mbstring" "opcache" "pcntl" "pdo" "pdo_mysql" "pdo_pgsql" "pdo_sqlite" "pgsql" "phar" "session" "simplexml" "soap" "xml")
|
|
|
|
|
|
#
|
|
# Helper functions
|
|
#
|
|
declare -i term_width=120
|
|
|
|
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 "Configure PHP modules"
|
|
case $PHP_VERSION in
|
|
'80' )
|
|
h2 "Configure GD"
|
|
docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp
|
|
;;
|
|
'74' )
|
|
h2 "Configure GD"
|
|
docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp
|
|
h2 "Install json module"
|
|
docker-php-ext-install -j$(nproc) json
|
|
;;
|
|
* )
|
|
h2 "Configure GD"
|
|
docker-php-ext-configure gd \
|
|
--with-freetype-dir=/usr/lib/ \
|
|
--with-png-dir=/usr/lib/ \
|
|
--with-jpeg-dir=/usr/lib/ \
|
|
--with-gd
|
|
h2 "Install json module"
|
|
docker-php-ext-install -j$(nproc) json
|
|
break
|
|
esac
|
|
|
|
h1 "Install PHP modules"
|
|
for module in "${PHP_MODULES[@]}"
|
|
do
|
|
h1 "Install module: ${module}"
|
|
docker-php-ext-install -j$(nproc) $module
|
|
done
|