Skip to content

Commit

Permalink
Use binary go-pear.phar from https://github.com/pear/pearweb_phars
Browse files Browse the repository at this point in the history
  • Loading branch information
BanzaiMan committed Feb 1, 2019
1 parent 50aafc3 commit 8ec4615
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion bin/compile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down

1 comment on commit 8ec4615

@BanzaiMan
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to make 2 GitHub API calls because pearweb_phar does not release binary files, but commits them to the repo instead. See pear/pearweb_phars#6.

Please sign in to comment.