Skip to content

Commit b0da7a5

Browse files
committed
Revert "Fetch go-pear.phar from pear.php.net again"
This reverts commit 862ccd5. The file on http://pear.php.net/go-pear.phar appears to have problems with PHP releases, resulting in pear installation failures such as https://travis-ci.org/travis-ci/php-src-builder/jobs/517224082#L566 PHP Warning: require_once(phar://go-pear.phar/PEAR/REST/13.php): failed to open stream: phar error: "PEAR/REST/13.php" is not a file in phar "go-pear.phar" in phar:///home/travis/.phpenv/versions/7.1.28/go-pear.phar/PEAR/Config.php on line 2067 We revert to fetching it from GitHub, which seems to work better.
1 parent 21520eb commit b0da7a5

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

bin/compile

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

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

519
if [[ ! $VERSION ]] ; then
@@ -20,17 +34,16 @@ php-build -i development "${VERSION}" "${INSTALL_DEST}/${VERSION}"
2034

2135
pushd "${INSTALL_DEST}/${VERSION}"
2236

23-
2437
# update default_cert_file
2538
sudo mkdir -p /usr/local/ssl
2639
sudo wget -O /usr/local/ssl/cert.pem https://curl.haxx.se/ca/cacert.pem
2740

28-
29-
# don't install pear on master (issue with php 8.0)
41+
# don't install pear on master or snapshots (issue with php 8.0)
3042
# this could be a temp issue though
3143
if [[ ! $VERSION =~ ^master$ || $VERSION =~ snapshot$ ]]; then
32-
curl -fsSL --retry 20 -O http://pear.php.net/go-pear.phar
33-
44+
# pear
45+
fetch_pear
46+
3447
env TZ=UTC $TRAVIS_BUILD_DIR/bin/install-pear
3548
rm go-pear.phar
3649
"$INSTALL_DEST/$VERSION/bin/pear" config-set php_ini "$INSTALL_DEST/$VERSION/etc/php.ini" system

0 commit comments

Comments
 (0)