diff --git a/data/special-requirements b/data/special-requirements index a28aa819..da236aa6 100644 --- a/data/special-requirements +++ b/data/special-requirements @@ -6,6 +6,7 @@ lz4 !jessie memprof !alpine3.9 !alpine3.10 !alpine3.11 !alpine3.12 !alpine3.13 !alpine3.14 !alpine3.15 parallel zts parle !jessie +pdo_snowflake !jessie !stretch !alpine phpy !buster pthreads zts saxon !alpine3.7 !alpine3.8 !alpine3.9 !alpine3.10 !alpine3.11 !7.2-alpine !7.3-alpine !7.4-alpine diff --git a/data/supported-extensions b/data/supported-extensions index 0d2abe0c..f396a96c 100644 --- a/data/supported-extensions +++ b/data/supported-extensions @@ -84,6 +84,7 @@ pdo_mysql 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3 8.4 8.5 pdo_oci 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3 8.4 pdo_odbc 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3 8.4 8.5 pdo_pgsql 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3 8.4 8.5 +pdo_snowflake 8.1 8.2 8.3 8.4 pdo_sqlsrv 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3 8.4 pgsql 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3 8.4 8.5 phalcon 7.2 7.3 7.4 8.0 8.1 8.2 8.3 8.4 diff --git a/install-php-extensions b/install-php-extensions index 8388fdc0..0f2a48d8 100755 --- a/install-php-extensions +++ b/install-php-extensions @@ -671,8 +671,8 @@ expandASpellDictionaries() { # $@: the PHP module handles # # Set: -# PACKAGES_PERSISTENT_NEW the list of packages required at runtume that must be installed -# PACKAGES_PERSISTENT_PRE the list of packages required at runtume that are already installed +# PACKAGES_PERSISTENT_NEW the list of packages required at runtime that must be installed +# PACKAGES_PERSISTENT_PRE the list of packages required at runtime that are already installed # PACKAGES_VOLATILE the list of packages required at compile time that must be installed # PACKAGES_PREVIOUS the list of packages (with their version) that are installed right now (calculated only on Debian and only if PACKAGES_PERSISTENT_NEW or PACKAGES_VOLATILE are not empty) # COMPILE_LIBS @@ -1464,6 +1464,10 @@ buildRequiredPackageLists() { buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile gnupg apt-transport-https" fi ;; + pdo_snowflake@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libstdc++6 libcurl4" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile cmake g++ $buildRequiredPackageLists_libssldev libcurl4-openssl-dev" + ;; ssh2@alpine) buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libssh2" buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libssh2-dev" @@ -1924,7 +1928,7 @@ getModuleFullPath() { # $1: the name of the PHP extension # # Return: -# 0 (true): if suceeded +# 0 (true): if succeeded # non-zero (false): in case of errors postProcessModule() { postProcessModule_file="$(getModuleFullPath "$1")" @@ -4345,6 +4349,29 @@ installRemoteModule() { fi fi ;; + pdo_snowflake) + if test -z "$installRemoteModule_version"; then + installRemoteModule_version="$(curl -sSLf https://api.github.com/repos/snowflakedb/pdo_snowflake/releases/latest 2>/dev/null | grep -o '"tag_name": *"[^"]*"' | head -1 | sed 's/.*"v*\([^"]*\)".*/\1/')" + if test -z "$installRemoteModule_version"; then + printf 'Failed to detect pdo_snowflake version\n' >&2 + exit 1 + fi + fi + installRemoteModule_src="$(getPackageSource "https://github.com/snowflakedb/pdo_snowflake/archive/refs/tags/v${installRemoteModule_version}.tar.gz")" + cd "$installRemoteModule_src" + chmod +x scripts/build_pdo_snowflake.sh + PHP_HOME="$(php-config --prefix)" ./scripts/build_pdo_snowflake.sh + cp modules/pdo_snowflake.so "$PHP_EXTDIR/pdo_snowflake.so" + if test -f libsnowflakeclient/cacert.pem; then + installRemoteModule_cacert_path="/usr/local/share/snowflake/cacert.pem" + mkdir -p "$(dirname "$installRemoteModule_cacert_path")" + cp libsnowflakeclient/cacert.pem "$installRemoteModule_cacert_path" + installRemoteModule_ini_extra="pdo_snowflake.cacert=$installRemoteModule_cacert_path" + fi + cd - >/dev/null + rm -rf "$installRemoteModule_src" + installRemoteModule_manuallyInstalled=1 + ;; ssh2) if test -z "$installRemoteModule_version"; then if test $PHP_MAJMIN_VERSION -le 506; then diff --git a/scripts/tests/pdo_snowflake b/scripts/tests/pdo_snowflake new file mode 100755 index 00000000..8bc30acc --- /dev/null +++ b/scripts/tests/pdo_snowflake @@ -0,0 +1,14 @@ +#!/usr/bin/env php +getMessage(), 'could not find driver') !== false || + stripos($x->getMessage(), 'invalid data source') !== false) { + fwrite(STDERR, trim($x->getMessage() . "\n")); + exit(1); + } +}