Skip to content

Commit

Permalink
Add swoole to the builds
Browse files Browse the repository at this point in the history
  • Loading branch information
shivammathur committed Nov 26, 2023
1 parent 78a6d51 commit 8e4985f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
16 changes: 16 additions & 0 deletions scripts/extensions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,19 @@ enable_pecl_extension() {
fetch_module "$extension"
phpenmod -v "$PHP_VERSION" "$extension"
}

configure_swoole() {
fetch_module swoole
pecl_ini_file="$(sudo pecl config-get php_ini)"
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() {
if [[ "$PHP_VERSION" =~ 7.[2-4] ]]; then
sudo pecl install -f swoole-4.8.13 && configure_swoole
elif [[ "$PHP_VERSION" =~ 8.[0-4] ]]; then
sudo pecl install -f swoole && configure_swoole
fi
}
2 changes: 2 additions & 0 deletions scripts/install-php-packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,8 @@ else
[ "${BUILDS:?}" = "debug" ] && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends "php$PHP_VERSION-mongodb$PHP_PKG_SUFFIX" 2>/dev/null || true
fi

add_swoole

DEBIAN_FRONTEND=noninteractive apt-get autoremove -y

sudo rm -rf /var/cache/apt/archives/*.deb || true
Expand Down
1 change: 1 addition & 0 deletions scripts/install-php-php-builder.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ cp /var/lib/dpkg/status /var/lib/dpkg/status-orig
DEBIAN_FRONTEND=noninteractive apt-get install -y libxpm-dev libwebp-dev libpcre3-dev libxmlrpc-epi-dev
curl -o /tmp/install.sh -sL "https://github.com/shivammathur/php-builder/releases/download/$PHP_VERSION/install.sh"
bash /tmp/install.sh github "$PHP_VERSION" "${BUILDS:?}" "${TS:?}"
add_swoole

0 comments on commit 8e4985f

Please sign in to comment.