From 86e1ccdd8ddc47bffc29bf667143f363a4cdfdbc Mon Sep 17 00:00:00 2001 From: Shivam Mathur Date: Fri, 19 Feb 2021 13:30:02 +0530 Subject: [PATCH] Fix pdo setup --- src/scripts/darwin.sh | 2 +- src/scripts/linux.sh | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/scripts/darwin.sh b/src/scripts/darwin.sh index c2bdf626..7fd28f07 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 a1e6c4be..4e0e3682 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 } @@ -92,7 +92,13 @@ add_pdo_extension() { 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" + ext_name='mysqli' + 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"