From 8ec4615897611c6bdca20985461a6cf0abbea0b6 Mon Sep 17 00:00:00 2001 From: Hiro Asari Date: Fri, 1 Feb 2019 08:46:59 -0500 Subject: [PATCH] Use binary go-pear.phar from https://github.com/pear/pearweb_phars --- bin/compile | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/bin/compile b/bin/compile index e8e6262..1ccd64d 100755 --- a/bin/compile +++ b/bin/compile @@ -1,5 +1,21 @@ #!/usr/bin/env bash +function fetch_pear() { + set +o xtrace + if [ -n $GITHUB_TOKEN ]; then + auth_flag="-H 'Authorization: token $GITHUB_TOKEN'" + fi + + latest_tag=$(curl -sSfL "${auth_flag}" https://api.github.com/repos/pear/pearweb_phars/releases/latest | jq -r .tag_name) + curl -sSfL "${auth_flag}" --retry 2 -O https://raw.githubusercontent.com/pear/pearweb_phars/${latest_tag}/go-pear.phar + + if [ ! -f go-pear.phar ]; then + echo "Latest PEAR tarball not found" + exit 1 + fi + set -o xtrace +} + set -o errexit if [[ ! $VERSION ]] ; then @@ -21,7 +37,8 @@ php-build -i development "${VERSION}" "${INSTALL_DEST}/${VERSION}" pushd "${INSTALL_DEST}/${VERSION}" # pear -curl -fsSL -O http://pear.php.net/go-pear.phar +fetch_pear + env TZ=UTC $TRAVIS_BUILD_DIR/bin/install-pear rm go-pear.phar "$INSTALL_DEST/$VERSION/bin/pear" config-set php_ini "$INSTALL_DEST/$VERSION/etc/php.ini" system