Skip to content

Commit

Permalink
feat:v8.3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Tinywan committed Mar 3, 2024
1 parent 8c22d86 commit 841fdfc
Showing 1 changed file with 24 additions and 19 deletions.
43 changes: 24 additions & 19 deletions extension/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,17 @@ export EXTENSIONS="gd,bcmath,pdo,mysqli,pdo_mysql,redis,bz2,calendar,opcache,pcn
# Param 2: Specific PHP Minor version
# Return : 1 if greater than or equal to, 0 if less than
#
isPhpVersionGreaterOrEqual() {
# local PHP_MAJOR_VERSION=$(php -r "echo PHP_MAJOR_VERSION;")
# local PHP_MINOR_VERSION=$(php -r "echo PHP_MINOR_VERSION;")

# if [[ "$PHP_MAJOR_VERSION" -gt "$1" || "$PHP_MAJOR_VERSION" -eq "$1" && "$PHP_MINOR_VERSION" -ge "$2" ]]; then
# return 1;
# else
# return 0;
# fi
return 0
}
isPhpVersionGreaterOrEqual()
{
local PHP_MAJOR_VERSION=$(php -r "echo PHP_MAJOR_VERSION;")
local PHP_MINOR_VERSION=$(php -r "echo PHP_MINOR_VERSION;")

if [[ "$PHP_MAJOR_VERSION" -gt "$1" || "$PHP_MAJOR_VERSION" -eq "$1" && "$PHP_MINOR_VERSION" -ge "$2" ]]; then
return 1;
else
return 0;
fi
}
#
# Install extension from package file(.tgz),
# For example:
Expand Down Expand Up @@ -187,7 +186,13 @@ fi

if [[ -z "${EXTENSIONS##*,gd,*}" ]]; then
echo "---------- Install gd ----------"
options="--with-freetype --with-jpeg --with-webp"
isPhpVersionGreaterOrEqual 8 0

if [[ "$?" = "1" ]]; then
options="--with-freetype --with-jpeg --with-webp"
else
options="--with-gd --with-freetype-dir=/usr/include/ --with-png-dir=/usr/include/ --with-jpeg-dir=/usr/include/ --with-webp-dir=/usr/include/"
fi

apk add --no-cache \
freetype \
Expand All @@ -196,13 +201,13 @@ if [[ -z "${EXTENSIONS##*,gd,*}" ]]; then
libpng-dev \
libjpeg-turbo \
libjpeg-turbo-dev \
libwebp-dev &&
docker-php-ext-configure gd ${options} &&
docker-php-ext-install ${MC} gd &&
apk del \
freetype-dev \
libpng-dev \
libjpeg-turbo-dev
libwebp-dev \
&& docker-php-ext-configure gd ${options} \
&& docker-php-ext-install ${MC} gd \
&& apk del \
freetype-dev \
libpng-dev \
libjpeg-turbo-dev
fi

if [[ -z "${EXTENSIONS##*,intl,*}" ]]; then
Expand Down

0 comments on commit 841fdfc

Please sign in to comment.