Skip to content

Commit

Permalink
Handle case when extension is not present (7.0-zts)
Browse files Browse the repository at this point in the history
  • Loading branch information
glensc committed Apr 19, 2020
1 parent 5bc7338 commit 05ee7f4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion install-extensions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ set -xeu
: ${TIDEWAYS_XHPROF_VERSION=5.0.2}
: ${PHP_VERSION=${TRAVIS_PHP_VERSION}}

die() {
echo >&2 "ERROR: $*"
exit 1
}

install_tideways_xhprof() {
local version=$TIDEWAYS_XHPROF_VERSION
local arch=$(uname -m)
Expand All @@ -22,7 +27,7 @@ install_tideways_xhprof() {
zts=$(php --version | grep -q ZTS && echo -zts || :)
library="$PWD/tideways_xhprof-$version/tideways_xhprof-$PHP_VERSION$zts.so"
config="$HOME/.phpenv/versions/$PHP_VERSION/etc/conf.d/tideways_xhprof.ini"
test -f "$library"
test -f "$library" || die "Extension not available: $library"
echo "extension=$library" > "$config"
php -m | grep -F "$extension"
}
Expand Down

0 comments on commit 05ee7f4

Please sign in to comment.