From 3f36c0511e6b5c06cdbb82f098b7a32ccf1a1203 Mon Sep 17 00:00:00 2001 From: Shivam Mathur Date: Fri, 19 Feb 2021 09:38:15 +0530 Subject: [PATCH] Fix pdo setup --- src/scripts/darwin.sh | 2 +- src/scripts/linux.sh | 15 +++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/scripts/darwin.sh b/src/scripts/darwin.sh index c2bdf626d..7fd28f071 100644 --- a/src/scripts/darwin.sh +++ b/src/scripts/darwin.sh @@ -11,7 +11,7 @@ self_hosted_helper() { remove_extension() { extension=$1 if check_extension "$extension"; then - sudo sed -Ei '' "/=(.*\/)?\"?$extension/d" "${ini_file:?}" + sudo sed -Ei '' "/=(.*\/)?\"?$extension(.so)?$/d" "${ini_file:?}" sudo rm -rf "${scan_dir:?}"/*"$extension"* "${ext_dir:?}"/"$extension".so >/dev/null 2>&1 (! check_extension "$extension" && add_log "${tick:?}" ":$extension" "Removed") || add_log "${cross:?}" ":$extension" "Could not remove $extension on PHP ${semver:?}" diff --git a/src/scripts/linux.sh b/src/scripts/linux.sh index a1e6c4be1..9c49cb2f7 100644 --- a/src/scripts/linux.sh +++ b/src/scripts/linux.sh @@ -48,8 +48,8 @@ install_packages() { # Function to disable an extension. disable_extension() { extension=$1 - sudo sed -Ei "/=(.*\/)?\"?$extension/d" "${ini_file[@]}" - sudo sed -Ei "/=(.*\/)?\"?$extension/d" "$pecl_file" + sudo sed -Ei "/=(.*\/)?\"?$extension(.so)?$/d" "${ini_file[@]}" + sudo sed -Ei "/=(.*\/)?\"?$extension(.so)?$/d" "$pecl_file" sudo find "$ini_dir"/.. -name "*$extension.ini" -delete >/dev/null 2>&1 || true } @@ -91,8 +91,15 @@ add_pdo_extension() { disable_extension pdo echo "extension=pdo.so" | sudo tee "${ini_file[@]/php.ini/conf.d/10-pdo.ini}" >/dev/null 2>&1 if [ "$ext" = "mysql" ]; then - enable_extension "mysqlnd" "extension" - ext_name="mysqli" + for mysql_ext in "$ext_dir"/*mysql*; do + enable_extension "${mysql_ext%.*}" "extension" + done + elif [ "$ext" = "dblib" ]; then + ext_name="sybase" + elif [ "$ext" = "firebird" ]; then + install_packages libfbclient2 >/dev/null 2>&1 + enable_extension "pdo_firebird" "extension" + ext_name="interbase" elif [ "$ext" = "sqlite" ]; then ext="sqlite3" ext_name="sqlite3"