Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions data/special-requirements
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions data/supported-extensions
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
33 changes: 30 additions & 3 deletions install-php-extensions
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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")"
Expand Down Expand Up @@ -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
Expand Down
14 changes: 14 additions & 0 deletions scripts/tests/pdo_snowflake
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env php
<?php

require_once __DIR__ . '/_bootstrap.php';

try {
new PDO('snowflake:account=test;warehouse=test;database=test;schema=test', 'test_user', 'test_password');
} catch (PDOException $x) {
if (stripos($x->getMessage(), 'could not find driver') !== false ||
stripos($x->getMessage(), 'invalid data source') !== false) {
fwrite(STDERR, trim($x->getMessage() . "\n"));
exit(1);
}
}