Fix pdo setup

This commit is contained in:
Shivam Mathur 2021-02-19 13:30:02 +05:30
parent 36ec0200a6
commit 86e1ccdd8d
No known key found for this signature in database
GPG Key ID: 3E13E4C8591ACC2A
2 changed files with 10 additions and 4 deletions

View File

@ -11,7 +11,7 @@ self_hosted_helper() {
remove_extension() { remove_extension() {
extension=$1 extension=$1
if check_extension "$extension"; then 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 sudo rm -rf "${scan_dir:?}"/*"$extension"* "${ext_dir:?}"/"$extension".so >/dev/null 2>&1
(! check_extension "$extension" && add_log "${tick:?}" ":$extension" "Removed") || (! check_extension "$extension" && add_log "${tick:?}" ":$extension" "Removed") ||
add_log "${cross:?}" ":$extension" "Could not remove $extension on PHP ${semver:?}" add_log "${cross:?}" ":$extension" "Could not remove $extension on PHP ${semver:?}"

View File

@ -48,8 +48,8 @@ install_packages() {
# Function to disable an extension. # Function to disable an extension.
disable_extension() { disable_extension() {
extension=$1 extension=$1
sudo sed -Ei "/=(.*\/)?\"?$extension/d" "${ini_file[@]}" sudo sed -Ei "/=(.*\/)?\"?$extension(.so)?$/d" "${ini_file[@]}"
sudo sed -Ei "/=(.*\/)?\"?$extension/d" "$pecl_file" sudo sed -Ei "/=(.*\/)?\"?$extension(.so)?$/d" "$pecl_file"
sudo find "$ini_dir"/.. -name "*$extension.ini" -delete >/dev/null 2>&1 || true 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 echo "extension=pdo.so" | sudo tee "${ini_file[@]/php.ini/conf.d/10-pdo.ini}" >/dev/null 2>&1
if [ "$ext" = "mysql" ]; then if [ "$ext" = "mysql" ]; then
enable_extension "mysqlnd" "extension" 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 elif [ "$ext" = "sqlite" ]; then
ext="sqlite3" ext="sqlite3"
ext_name="sqlite3" ext_name="sqlite3"