From 1be3c17e787552bf16749cbfa1c6ff6bbaf7940a Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Wed, 16 Feb 2022 17:31:14 +0100 Subject: [PATCH] sqlsrv and pdo_sqlsrv; use Microsoft ODBC 18 when available, support Debian Bullseye (#512) --- data/special-requirements | 4 ++-- install-php-extensions | 15 +++++++++++++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/data/special-requirements b/data/special-requirements index 2faaad8..205eaec 100644 --- a/data/special-requirements +++ b/data/special-requirements @@ -1,6 +1,6 @@ parallel zts -pdo_sqlsrv !alpine3.7 !alpine3.8 !bullseye +pdo_sqlsrv !alpine3.7 !alpine3.8 !7.3-bullseye pthreads zts -sqlsrv !alpine3.7 !alpine3.8 !7.1-alpine3.9 !7.1-alpine3.10 !bullseye +sqlsrv !alpine3.7 !alpine3.8 !7.1-alpine3.9 !7.1-alpine3.10 !7.3-bullseye tensor !alpine3.15 vips !alpine3.7 !alpine3.8 !alpine3.9 !jessie diff --git a/install-php-extensions b/install-php-extensions index b178237..399e336 100755 --- a/install-php-extensions +++ b/install-php-extensions @@ -1492,7 +1492,11 @@ installMicrosoftSqlServerODBC() { alpine) # https://docs.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server#alpine17 rm -rf /tmp/src/msodbcsql.apk - curl -sSLf -o /tmp/src/msodbcsql.apk https://download.microsoft.com/download/e/4/e/e4e67866-dffd-428c-aac7-8d28ddafb39b/msodbcsql17_17.8.1.1-1_amd64.apk + if test $PHP_MAJMIN_VERSION -le 703; then + curl -sSLf -o /tmp/src/msodbcsql.apk https://download.microsoft.com/download/e/4/e/e4e67866-dffd-428c-aac7-8d28ddafb39b/msodbcsql17_17.8.1.1-1_amd64.apk + else + curl -sSLf -o /tmp/src/msodbcsql.apk https://download.microsoft.com/download/b/9/f/b9f3cce4-3925-46d4-9f46-da08869c6486/msodbcsql18_18.0.1.1-1_amd64.apk + fi printf '\n' | apk add --allow-untrusted /tmp/src/msodbcsql.apk rm -rf /tmp/src/msodbcsql.apk ;; @@ -1511,7 +1515,14 @@ installMicrosoftSqlServerODBC() { DEBIAN_FRONTEND=noninteractive apt-get -q update fi printf -- '- installing the APT package\n' - DEBIAN_FRONTEND=noninteractive ACCEPT_EULA=Y apt-get -qy --no-install-recommends install '^msodbcsql[0-9]+$' + if test $PHP_MAJMIN_VERSION -le 703; then + DEBIAN_FRONTEND=noninteractive ACCEPT_EULA=Y apt-get -qy --no-install-recommends install msodbcsql17 + elif test $DISTRO_VERSION_NUMBER -ge 9 && $DISTRO_VERSION_NUMBER -le 10; then + # On Debian 9 and 10 we have both msodbcsql17 and msodbcsql18: let's install just one + DEBIAN_FRONTEND=noninteractive ACCEPT_EULA=Y apt-get -qy --no-install-recommends install msodbcsql18 + else + DEBIAN_FRONTEND=noninteractive ACCEPT_EULA=Y apt-get -qy --no-install-recommends install '^msodbcsql[0-9]+$' + fi ;; esac }