From 3f9759d2300188842d24eb92cf12e4220d9664cc Mon Sep 17 00:00:00 2001 From: zhengkunwang223 Date: Wed, 27 Dec 2023 10:46:06 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=20PHP=20=E5=AE=89?= =?UTF-8?q?=E8=A3=85=20sqlsrv=20=E5=A4=B1=E8=B4=A5=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../7.0.33/build/php/extensions/install.sh | 12 +++-------- .../7.1.33/build/php/extensions/install.sh | 12 +++-------- .../7.2.34/build/php/extensions/install.sh | 12 +++-------- .../7.3.33/build/php/extensions/install.sh | 12 +++-------- .../7.4.33/build/php/extensions/install.sh | 12 +++-------- .../8.0.30/build/php/extensions/install.sh | 12 +++-------- .../8.1.23/build/php/extensions/install.sh | 12 +++-------- .../8.2.10/build/php/extensions/install.sh | 20 +++++++------------ 8 files changed, 28 insertions(+), 76 deletions(-) diff --git a/apps/php7/7.0.33/build/php/extensions/install.sh b/apps/php7/7.0.33/build/php/extensions/install.sh index 4912aa67..1507b0ed 100644 --- a/apps/php7/7.0.33/build/php/extensions/install.sh +++ b/apps/php7/7.0.33/build/php/extensions/install.sh @@ -471,11 +471,7 @@ if [[ -z "${EXTENSIONS##*,pdo_sqlsrv,*}" ]]; then isPhpVersionGreaterOrEqual 7 1 if [[ "$?" = "1" ]]; then echo "---------- Install pdo_sqlsrv ----------" - apk add --no-cache unixodbc-dev - printf "\n" | pecl install pdo_sqlsrv - docker-php-ext-enable pdo_sqlsrv - curl -o /tmp/msodbcsql17_amd64.apk https://download.microsoft.com/download/e/4/e/e4e67866-dffd-428c-aac7-8d28ddafb39b/msodbcsql17_17.5.2.1-1_amd64.apk - apk add --allow-untrusted /tmp/msodbcsql17_amd64.apk + install-php-extensions pdo_sqlsrv else echo "pdo_sqlsrv requires PHP >= 7.1.0, installed version is ${PHP_VERSION}" fi @@ -485,11 +481,9 @@ if [[ -z "${EXTENSIONS##*,sqlsrv,*}" ]]; then isPhpVersionGreaterOrEqual 7 1 if [[ "$?" = "1" ]]; then echo "---------- Install sqlsrv ----------" - apk add --no-cache unixodbc-dev - printf "\n" | pecl install sqlsrv - docker-php-ext-enable sqlsrv + install-php-extensions sqlsrv else - echo "pdo_sqlsrv requires PHP >= 7.1.0, installed version is ${PHP_VERSION}" + echo "sqlsrv requires PHP >= 7.1.0, installed version is ${PHP_VERSION}" fi fi diff --git a/apps/php7/7.1.33/build/php/extensions/install.sh b/apps/php7/7.1.33/build/php/extensions/install.sh index 4912aa67..1507b0ed 100644 --- a/apps/php7/7.1.33/build/php/extensions/install.sh +++ b/apps/php7/7.1.33/build/php/extensions/install.sh @@ -471,11 +471,7 @@ if [[ -z "${EXTENSIONS##*,pdo_sqlsrv,*}" ]]; then isPhpVersionGreaterOrEqual 7 1 if [[ "$?" = "1" ]]; then echo "---------- Install pdo_sqlsrv ----------" - apk add --no-cache unixodbc-dev - printf "\n" | pecl install pdo_sqlsrv - docker-php-ext-enable pdo_sqlsrv - curl -o /tmp/msodbcsql17_amd64.apk https://download.microsoft.com/download/e/4/e/e4e67866-dffd-428c-aac7-8d28ddafb39b/msodbcsql17_17.5.2.1-1_amd64.apk - apk add --allow-untrusted /tmp/msodbcsql17_amd64.apk + install-php-extensions pdo_sqlsrv else echo "pdo_sqlsrv requires PHP >= 7.1.0, installed version is ${PHP_VERSION}" fi @@ -485,11 +481,9 @@ if [[ -z "${EXTENSIONS##*,sqlsrv,*}" ]]; then isPhpVersionGreaterOrEqual 7 1 if [[ "$?" = "1" ]]; then echo "---------- Install sqlsrv ----------" - apk add --no-cache unixodbc-dev - printf "\n" | pecl install sqlsrv - docker-php-ext-enable sqlsrv + install-php-extensions sqlsrv else - echo "pdo_sqlsrv requires PHP >= 7.1.0, installed version is ${PHP_VERSION}" + echo "sqlsrv requires PHP >= 7.1.0, installed version is ${PHP_VERSION}" fi fi diff --git a/apps/php7/7.2.34/build/php/extensions/install.sh b/apps/php7/7.2.34/build/php/extensions/install.sh index 4912aa67..1507b0ed 100644 --- a/apps/php7/7.2.34/build/php/extensions/install.sh +++ b/apps/php7/7.2.34/build/php/extensions/install.sh @@ -471,11 +471,7 @@ if [[ -z "${EXTENSIONS##*,pdo_sqlsrv,*}" ]]; then isPhpVersionGreaterOrEqual 7 1 if [[ "$?" = "1" ]]; then echo "---------- Install pdo_sqlsrv ----------" - apk add --no-cache unixodbc-dev - printf "\n" | pecl install pdo_sqlsrv - docker-php-ext-enable pdo_sqlsrv - curl -o /tmp/msodbcsql17_amd64.apk https://download.microsoft.com/download/e/4/e/e4e67866-dffd-428c-aac7-8d28ddafb39b/msodbcsql17_17.5.2.1-1_amd64.apk - apk add --allow-untrusted /tmp/msodbcsql17_amd64.apk + install-php-extensions pdo_sqlsrv else echo "pdo_sqlsrv requires PHP >= 7.1.0, installed version is ${PHP_VERSION}" fi @@ -485,11 +481,9 @@ if [[ -z "${EXTENSIONS##*,sqlsrv,*}" ]]; then isPhpVersionGreaterOrEqual 7 1 if [[ "$?" = "1" ]]; then echo "---------- Install sqlsrv ----------" - apk add --no-cache unixodbc-dev - printf "\n" | pecl install sqlsrv - docker-php-ext-enable sqlsrv + install-php-extensions sqlsrv else - echo "pdo_sqlsrv requires PHP >= 7.1.0, installed version is ${PHP_VERSION}" + echo "sqlsrv requires PHP >= 7.1.0, installed version is ${PHP_VERSION}" fi fi diff --git a/apps/php7/7.3.33/build/php/extensions/install.sh b/apps/php7/7.3.33/build/php/extensions/install.sh index 4912aa67..1507b0ed 100644 --- a/apps/php7/7.3.33/build/php/extensions/install.sh +++ b/apps/php7/7.3.33/build/php/extensions/install.sh @@ -471,11 +471,7 @@ if [[ -z "${EXTENSIONS##*,pdo_sqlsrv,*}" ]]; then isPhpVersionGreaterOrEqual 7 1 if [[ "$?" = "1" ]]; then echo "---------- Install pdo_sqlsrv ----------" - apk add --no-cache unixodbc-dev - printf "\n" | pecl install pdo_sqlsrv - docker-php-ext-enable pdo_sqlsrv - curl -o /tmp/msodbcsql17_amd64.apk https://download.microsoft.com/download/e/4/e/e4e67866-dffd-428c-aac7-8d28ddafb39b/msodbcsql17_17.5.2.1-1_amd64.apk - apk add --allow-untrusted /tmp/msodbcsql17_amd64.apk + install-php-extensions pdo_sqlsrv else echo "pdo_sqlsrv requires PHP >= 7.1.0, installed version is ${PHP_VERSION}" fi @@ -485,11 +481,9 @@ if [[ -z "${EXTENSIONS##*,sqlsrv,*}" ]]; then isPhpVersionGreaterOrEqual 7 1 if [[ "$?" = "1" ]]; then echo "---------- Install sqlsrv ----------" - apk add --no-cache unixodbc-dev - printf "\n" | pecl install sqlsrv - docker-php-ext-enable sqlsrv + install-php-extensions sqlsrv else - echo "pdo_sqlsrv requires PHP >= 7.1.0, installed version is ${PHP_VERSION}" + echo "sqlsrv requires PHP >= 7.1.0, installed version is ${PHP_VERSION}" fi fi diff --git a/apps/php7/7.4.33/build/php/extensions/install.sh b/apps/php7/7.4.33/build/php/extensions/install.sh index 4912aa67..1507b0ed 100644 --- a/apps/php7/7.4.33/build/php/extensions/install.sh +++ b/apps/php7/7.4.33/build/php/extensions/install.sh @@ -471,11 +471,7 @@ if [[ -z "${EXTENSIONS##*,pdo_sqlsrv,*}" ]]; then isPhpVersionGreaterOrEqual 7 1 if [[ "$?" = "1" ]]; then echo "---------- Install pdo_sqlsrv ----------" - apk add --no-cache unixodbc-dev - printf "\n" | pecl install pdo_sqlsrv - docker-php-ext-enable pdo_sqlsrv - curl -o /tmp/msodbcsql17_amd64.apk https://download.microsoft.com/download/e/4/e/e4e67866-dffd-428c-aac7-8d28ddafb39b/msodbcsql17_17.5.2.1-1_amd64.apk - apk add --allow-untrusted /tmp/msodbcsql17_amd64.apk + install-php-extensions pdo_sqlsrv else echo "pdo_sqlsrv requires PHP >= 7.1.0, installed version is ${PHP_VERSION}" fi @@ -485,11 +481,9 @@ if [[ -z "${EXTENSIONS##*,sqlsrv,*}" ]]; then isPhpVersionGreaterOrEqual 7 1 if [[ "$?" = "1" ]]; then echo "---------- Install sqlsrv ----------" - apk add --no-cache unixodbc-dev - printf "\n" | pecl install sqlsrv - docker-php-ext-enable sqlsrv + install-php-extensions sqlsrv else - echo "pdo_sqlsrv requires PHP >= 7.1.0, installed version is ${PHP_VERSION}" + echo "sqlsrv requires PHP >= 7.1.0, installed version is ${PHP_VERSION}" fi fi diff --git a/apps/php8/8.0.30/build/php/extensions/install.sh b/apps/php8/8.0.30/build/php/extensions/install.sh index 3bb97cb2..7bdd718f 100644 --- a/apps/php8/8.0.30/build/php/extensions/install.sh +++ b/apps/php8/8.0.30/build/php/extensions/install.sh @@ -469,11 +469,7 @@ if [[ -z "${EXTENSIONS##*,pdo_sqlsrv,*}" ]]; then isPhpVersionGreaterOrEqual 8 0 if [[ "$?" = "1" ]]; then echo "---------- Install pdo_sqlsrv ----------" - apk add --no-cache unixodbc-dev - printf "\n" | pecl install pdo_sqlsrv - docker-php-ext-enable pdo_sqlsrv - curl -o /tmp/msodbcsql17_amd64.apk https://download.microsoft.com/download/e/4/e/e4e67866-dffd-428c-aac7-8d28ddafb39b/msodbcsql17_17.5.2.1-1_amd64.apk - apk add --allow-untrusted /tmp/msodbcsql17_amd64.apk + install-php-extensions pdo_sqlsrv else echo "pdo_sqlsrv requires PHP >= 8.0.0, installed version is ${PHP_VERSION}" fi @@ -483,11 +479,9 @@ if [[ -z "${EXTENSIONS##*,sqlsrv,*}" ]]; then isPhpVersionGreaterOrEqual 8 0 if [[ "$?" = "1" ]]; then echo "---------- Install sqlsrv ----------" - apk add --no-cache unixodbc-dev - printf "\n" | pecl install sqlsrv - docker-php-ext-enable sqlsrv + install-php-extensions sqlsrv else - echo "pdo_sqlsrv requires PHP >= 8.0.0, installed version is ${PHP_VERSION}" + echo "sqlsrv requires PHP >= 8.0.0, installed version is ${PHP_VERSION}" fi fi diff --git a/apps/php8/8.1.23/build/php/extensions/install.sh b/apps/php8/8.1.23/build/php/extensions/install.sh index 3bb97cb2..7bdd718f 100644 --- a/apps/php8/8.1.23/build/php/extensions/install.sh +++ b/apps/php8/8.1.23/build/php/extensions/install.sh @@ -469,11 +469,7 @@ if [[ -z "${EXTENSIONS##*,pdo_sqlsrv,*}" ]]; then isPhpVersionGreaterOrEqual 8 0 if [[ "$?" = "1" ]]; then echo "---------- Install pdo_sqlsrv ----------" - apk add --no-cache unixodbc-dev - printf "\n" | pecl install pdo_sqlsrv - docker-php-ext-enable pdo_sqlsrv - curl -o /tmp/msodbcsql17_amd64.apk https://download.microsoft.com/download/e/4/e/e4e67866-dffd-428c-aac7-8d28ddafb39b/msodbcsql17_17.5.2.1-1_amd64.apk - apk add --allow-untrusted /tmp/msodbcsql17_amd64.apk + install-php-extensions pdo_sqlsrv else echo "pdo_sqlsrv requires PHP >= 8.0.0, installed version is ${PHP_VERSION}" fi @@ -483,11 +479,9 @@ if [[ -z "${EXTENSIONS##*,sqlsrv,*}" ]]; then isPhpVersionGreaterOrEqual 8 0 if [[ "$?" = "1" ]]; then echo "---------- Install sqlsrv ----------" - apk add --no-cache unixodbc-dev - printf "\n" | pecl install sqlsrv - docker-php-ext-enable sqlsrv + install-php-extensions sqlsrv else - echo "pdo_sqlsrv requires PHP >= 8.0.0, installed version is ${PHP_VERSION}" + echo "sqlsrv requires PHP >= 8.0.0, installed version is ${PHP_VERSION}" fi fi diff --git a/apps/php8/8.2.10/build/php/extensions/install.sh b/apps/php8/8.2.10/build/php/extensions/install.sh index 2253ca84..7bdd718f 100644 --- a/apps/php8/8.2.10/build/php/extensions/install.sh +++ b/apps/php8/8.2.10/build/php/extensions/install.sh @@ -62,9 +62,9 @@ installExtensionFromTgz() tgzName=$1 para1= extensionName="${tgzName%%-*}" - if [ $2 ]; then + if [ $2 ]; then para1=$2 - fi + fi mkdir ${extensionName} tar -xf ${tgzName}.tgz -C ${extensionName} --strip-components=1 ( cd ${extensionName} && phpize && ./configure ${para1} && make ${MC} && make install ) @@ -469,11 +469,7 @@ if [[ -z "${EXTENSIONS##*,pdo_sqlsrv,*}" ]]; then isPhpVersionGreaterOrEqual 8 0 if [[ "$?" = "1" ]]; then echo "---------- Install pdo_sqlsrv ----------" - apk add --no-cache unixodbc-dev - printf "\n" | pecl install pdo_sqlsrv - docker-php-ext-enable pdo_sqlsrv - curl -o /tmp/msodbcsql17_amd64.apk https://download.microsoft.com/download/e/4/e/e4e67866-dffd-428c-aac7-8d28ddafb39b/msodbcsql17_17.5.2.1-1_amd64.apk - apk add --allow-untrusted /tmp/msodbcsql17_amd64.apk + install-php-extensions pdo_sqlsrv else echo "pdo_sqlsrv requires PHP >= 8.0.0, installed version is ${PHP_VERSION}" fi @@ -483,11 +479,9 @@ if [[ -z "${EXTENSIONS##*,sqlsrv,*}" ]]; then isPhpVersionGreaterOrEqual 8 0 if [[ "$?" = "1" ]]; then echo "---------- Install sqlsrv ----------" - apk add --no-cache unixodbc-dev - printf "\n" | pecl install sqlsrv - docker-php-ext-enable sqlsrv + install-php-extensions sqlsrv else - echo "pdo_sqlsrv requires PHP >= 8.0.0, installed version is ${PHP_VERSION}" + echo "sqlsrv requires PHP >= 8.0.0, installed version is ${PHP_VERSION}" fi fi @@ -541,7 +535,7 @@ if [[ -z "${EXTENSIONS##*,amqp,*}" ]]; then && printf '\n' | pecl install amqp \ && docker-php-ext-enable amqp \ && apk del .phpize-deps-configure - + fi if [[ -z "${EXTENSIONS##*,redis,*}" ]]; then @@ -601,7 +595,7 @@ fi if [[ -z "${EXTENSIONS##*,swoole,*}" ]]; then - echo "---------- Install swoole ----------" + echo "---------- Install swoole ----------" isPhpVersionGreaterOrEqual 8 0 if [[ "$?" = "1" ]]; then installExtensionFromTgz swoole-5.0.2 --enable-openssl