Skip to content

Commit 8ec4615

Browse files
committed
Use binary go-pear.phar from https://github.com/pear/pearweb_phars
1 parent 50aafc3 commit 8ec4615

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

bin/compile

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
#!/usr/bin/env bash
22

3+
function fetch_pear() {
4+
set +o xtrace
5+
if [ -n $GITHUB_TOKEN ]; then
6+
auth_flag="-H 'Authorization: token $GITHUB_TOKEN'"
7+
fi
8+
9+
latest_tag=$(curl -sSfL "${auth_flag}" https://api.github.com/repos/pear/pearweb_phars/releases/latest | jq -r .tag_name)
10+
curl -sSfL "${auth_flag}" --retry 2 -O https://raw.githubusercontent.com/pear/pearweb_phars/${latest_tag}/go-pear.phar
11+
12+
if [ ! -f go-pear.phar ]; then
13+
echo "Latest PEAR tarball not found"
14+
exit 1
15+
fi
16+
set -o xtrace
17+
}
18+
319
set -o errexit
420

521
if [[ ! $VERSION ]] ; then
@@ -21,7 +37,8 @@ php-build -i development "${VERSION}" "${INSTALL_DEST}/${VERSION}"
2137
pushd "${INSTALL_DEST}/${VERSION}"
2238

2339
# pear
24-
curl -fsSL -O http://pear.php.net/go-pear.phar
40+
fetch_pear
41+
2542
env TZ=UTC $TRAVIS_BUILD_DIR/bin/install-pear
2643
rm go-pear.phar
2744
"$INSTALL_DEST/$VERSION/bin/pear" config-set php_ini "$INSTALL_DEST/$VERSION/etc/php.ini" system

0 commit comments

Comments
 (0)