mirror of
https://github.com/shivammathur/setup-php.git
synced 2024-11-22 20:01:06 +07:00
Fix add_pdo_extension in linux.sh
This commit is contained in:
parent
77721f6637
commit
1e119b6d1a
@ -45,12 +45,19 @@ install_packages() {
|
|||||||
$apt_install "${packages[@]}" >/dev/null 2>&1 || update_lists && $apt_install "${packages[@]}" >/dev/null 2>&1
|
$apt_install "${packages[@]}" >/dev/null 2>&1 || update_lists && $apt_install "${packages[@]}" >/dev/null 2>&1
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to delete extensions.
|
# Function to disable an extension.
|
||||||
delete_extension() {
|
disable_extension() {
|
||||||
extension=$1
|
extension=$1
|
||||||
sudo sed -Ei "/=(.*\/)?\"?$extension/d" "${ini_file[@]}"
|
sudo sed -Ei "/=(.*\/)?\"?$extension/d" "${ini_file[@]}"
|
||||||
sudo sed -Ei "/=(.*\/)?\"?$extension/d" "$pecl_file"
|
sudo sed -Ei "/=(.*\/)?\"?$extension/d" "$pecl_file"
|
||||||
sudo rm -rf "$scan_dir"/*"$extension"* "$ext_dir"/"$extension".so >/dev/null 2>&1
|
sudo find "$ini_dir"/.. -name "*$extension.ini" -delete >/dev/null 2>&1 || true
|
||||||
|
}
|
||||||
|
|
||||||
|
# Function to delete an extension.
|
||||||
|
delete_extension() {
|
||||||
|
extension=$1
|
||||||
|
disable_extension "$extension"
|
||||||
|
sudo rm -rf "$ext_dir"/"$extension".so >/dev/null 2>&1
|
||||||
if [ "${runner:?}" = "self-hosted" ]; then
|
if [ "${runner:?}" = "self-hosted" ]; then
|
||||||
$apt_remove "php-$extension" "php$version-$extension" >/dev/null 2>&1 || true
|
$apt_remove "php-$extension" "php$version-$extension" >/dev/null 2>&1 || true
|
||||||
fi
|
fi
|
||||||
@ -81,8 +88,8 @@ add_pdo_extension() {
|
|||||||
else
|
else
|
||||||
ext=$1
|
ext=$1
|
||||||
ext_name=$1
|
ext_name=$1
|
||||||
sudo rm -rf "$scan_dir"/*pdo.ini >/dev/null 2>&1
|
disable_extension pdo
|
||||||
if ! check_extension "pdo" 2>/dev/null; then echo "extension=pdo.so" | sudo tee -a "${ini_file[@]}" >/dev/null 2>&1; fi
|
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"
|
||||||
|
Loading…
Reference in New Issue
Block a user