Fix to not delete pecl.ini when disabling extensions

This commit is contained in:
Shivam Mathur 2022-01-16 09:37:27 +05:30
parent c2a765ed5b
commit 282305f4d7
No known key found for this signature in database
GPG Key ID: 3E13E4C8591ACC2A
2 changed files with 2 additions and 2 deletions

View File

@ -94,7 +94,7 @@ disable_extension() {
# Function to disable shared extensions.
disable_all_shared() {
sudo sed -i.orig -E -e "/^(zend_)?extension\s*=/d" "${ini_file[@]}" "$pecl_file" 2>/dev/null || true
sudo find "${ini_dir:-$scan_dir}"/.. -name "*.ini" -not -path "*php.ini" -not -path "*phar.ini" -not -path "*mods-available*" -delete >/dev/null 2>&1 || true
sudo find "${ini_dir:-$scan_dir}"/.. -name "*.ini" -not -path "*php.ini" -not -path "*phar.ini" -not -path "*pecl.ini" -not -path "*mods-available*" -delete >/dev/null 2>&1 || true
add_log "${tick:?}" "none" "Disabled all shared extensions"
}

View File

@ -29,7 +29,7 @@ disable_extension_helper() {
disable_extension_dependents "$extension"
fi
sudo sed -Ei "/=(.*\/)?\"?$extension(.so)?$/d" "${ini_file[@]}" "$pecl_file"
sudo find "$ini_dir"/.. -name "*$extension.ini" -not -path "*phar.ini" -not -path "*mods-available*" -delete >/dev/null 2>&1 || true
sudo find "$ini_dir"/.. -name "*$extension.ini" -not -path "*phar.ini" -not -path "*pecl.ini" -not -path "*mods-available*" -delete >/dev/null 2>&1 || true
}
# Function to add PDO extension.