mirror of
https://github.com/shivammathur/setup-php.git
synced 2024-11-30 07:13:04 +07:00
Fix extension setup
This commit is contained in:
parent
e9a7adef28
commit
6dba529f13
@ -126,9 +126,8 @@ enable_cache_extension() {
|
||||
|
||||
# Function to enable existing extensions.
|
||||
enable_extension() {
|
||||
if [ -e /tmp/setup_php_dismod ] && grep -q "$1" /tmp/setup_php_dismod; then
|
||||
sudo phpenmod -v "$version" "$1" >/dev/null 2>&1
|
||||
fi
|
||||
modules_dir="/var/lib/php/modules/$version"
|
||||
[ -d "$modules_dir" ] && sudo find "$modules_dir" -path "*disabled*$1" -delete
|
||||
if [ -d /tmp/extcache/"$1" ]; then
|
||||
enable_cache_extension "$1" "$2"
|
||||
elif ! check_extension "$1" && [ -e "${ext_dir:?}/$1.so" ]; then
|
||||
|
@ -57,9 +57,7 @@ delete_extension() {
|
||||
extension=$1
|
||||
disable_extension "$extension"
|
||||
sudo rm -rf "$ext_dir"/"$extension".so >/dev/null 2>&1
|
||||
if [ "${runner:?}" = "self-hosted" ]; then
|
||||
$apt_remove "php-$extension" "php$version-$extension" >/dev/null 2>&1 || true
|
||||
fi
|
||||
sudo sed -i "/Package: php$version-$extension/,/^$/d" /var/lib/dpkg/status
|
||||
}
|
||||
|
||||
# Function to disable and delete extensions.
|
||||
@ -68,7 +66,6 @@ remove_extension() {
|
||||
if check_extension "$extension"; then
|
||||
if [[ ! "$version" =~ ${old_versions:?} ]] && [ -e /etc/php/"$version"/mods-available/"$extension".ini ]; then
|
||||
sudo phpdismod -v "$version" "$extension" >/dev/null 2>&1
|
||||
echo "$extension" | sudo tee -a /tmp/setup_php_dismod >/dev/null 2>&1
|
||||
fi
|
||||
delete_extension "$extension"
|
||||
(! check_extension "$extension" && add_log "${tick:?}" ":$extension" "Removed") ||
|
||||
|
Loading…
Reference in New Issue
Block a user