From 2975caeb1b7511e5e4c86331ae4fdf387865cbfa Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Thu, 1 Jul 2021 15:23:07 +0200 Subject: [PATCH] Support pdo_sqlsrv and sqlsrv on PHP 8.1 --- data/supported-extensions | 4 ++-- install-php-extensions | 19 ++++++++++++++++--- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/data/supported-extensions b/data/supported-extensions index 68b17a7..2375932 100644 --- a/data/supported-extensions +++ b/data/supported-extensions @@ -61,7 +61,7 @@ pdo_mysql 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 pdo_oci 7.0 7.1 7.2 7.3 7.4 8.0 8.1 pdo_odbc 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 pdo_pgsql 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 -pdo_sqlsrv 7.0 7.1 7.2 7.3 7.4 8.0 +pdo_sqlsrv 7.0 7.1 7.2 7.3 7.4 8.0 8.1 pgsql 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 propro 5.5 5.6 7.0 7.1 7.2 7.3 7.4 protobuf 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 @@ -79,7 +79,7 @@ snuffleupagus 7.0 7.1 7.2 7.3 7.4 8.0 soap 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 sockets 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 solr 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 -sqlsrv 7.0 7.1 7.2 7.3 7.4 8.0 +sqlsrv 7.0 7.1 7.2 7.3 7.4 8.0 8.1 ssh2 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 swoole 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 sybase_ct 5.5 5.6 diff --git a/install-php-extensions b/install-php-extensions index 514a23d..07d23be 100755 --- a/install-php-extensions +++ b/install-php-extensions @@ -1950,6 +1950,7 @@ installRemoteModule() { fi ;; sqlsrv | pdo_sqlsrv) + isMicrosoftSqlServerODBCInstalled || installMicrosoftSqlServerODBC if test -z "$installRemoteModule_version"; then # https://docs.microsoft.com/it-it/sql/connect/php/system-requirements-for-the-php-sql-driver?view=sql-server-2017 if test $PHP_MAJMIN_VERSION -le 506; then @@ -1960,11 +1961,22 @@ installRemoteModule() { installRemoteModule_version=5.6.1 elif test $PHP_MAJMIN_VERSION -le 702; then installRemoteModule_version=5.8.1 + elif test $PHP_MAJMIN_VERSION -ge 801; then + # https://github.com/microsoft/msphpsql/commits/PHP-8.1-dev + installRemoteModule_src="$(getPackageSource https://codeload.github.com/microsoft/msphpsql/tar.gz/f00dc9f0c555eebaf9f1e5a9bd1a04044908bba1)" + cd -- "$installRemoteModule_src/source/$installRemoteModule_module" + if command -v bash >/dev/null; then + (cd .. && bash ./packagize.sh) + else + (cd .. && sh ./packagize.sh) + fi + phpize + ./configure + make -j$(getProcessorCount) install + cd - >/dev/null + installRemoteModule_manuallyInstalled=1 fi fi - if ! isMicrosoftSqlServerODBCInstalled; then - installMicrosoftSqlServerODBC - fi ;; ssh2) if test -z "$installRemoteModule_version"; then @@ -2132,6 +2144,7 @@ installRemoteModule() { cmake -D USE_SHARED_PHPCPP:BOOL=ON .. make make install + cd - >/dev/null rm "$PHP_INI_DIR/conf.d/tdlib.ini" installRemoteModule_manuallyInstalled=1 ;;