Skip to content

Commit

Permalink
Fix caching PHP 8.4 --skip-cache
Browse files Browse the repository at this point in the history
  • Loading branch information
shivammathur committed Dec 9, 2023
1 parent f119583 commit eaf9087
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions scripts/extensions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,18 @@ enable_pecl_extension() {
}

configure_swoole() {
fetch_module swoole
pecl_ini_file="$(sudo pecl config-get php_ini)"
pecl_ini_file=$1
fetch_module swoole
if [[ -n "$pecl_ini_file" && -e "$pecl_ini_file" ]]; then
grep -q swoole "$pecl_ini_file" && sudo sed -i -e '/swoole/d' "$pecl_ini_file"
fi
}

add_swoole() {
pecl_ini_file="$(sudo pecl config-get php_ini)"
if [[ "$PHP_VERSION" =~ 7.[2-4] ]]; then
sudo pecl install -f swoole-4.8.13 && configure_swoole
sudo pecl install -f swoole-4.8.13 && configure_swoole "$pecl_ini_file"
elif [[ "$PHP_VERSION" =~ 8.[0-4] ]]; then
sudo pecl install -f swoole && configure_swoole
sudo pecl install -f swoole && configure_swoole "$pecl_ini_file"
fi
}

0 comments on commit eaf9087

Please sign in to comment.