summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorStephen Reay <stephen.reay@me.com>2019-08-10 20:10:16 +0700
committerNikita Popov <nikita.ppv@gmail.com>2019-08-10 16:21:03 +0200
commit9c02c584819369b7e1fd1ab515a2e5c411355b11 (patch)
treefad85e1f6f3de100325f2479d8938a6ff7c4ec20 /scripts
parent17987da884f8ff1147f4804ce42622a001eb7210 (diff)
downloadphp-git-9c02c584819369b7e1fd1ab515a2e5c411355b11.tar.gz
Fallback to curl in gen_stub if wget fails
Closes GH-4502.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/dev/gen_stub.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/scripts/dev/gen_stub.php b/scripts/dev/gen_stub.php
index 993be075d7..f61893050c 100755
--- a/scripts/dev/gen_stub.php
+++ b/scripts/dev/gen_stub.php
@@ -384,8 +384,12 @@ function initPhpParser() {
if (!is_dir($phpParserDir)) {
$cwd = getcwd();
chdir(__DIR__);
+
passthru("wget https://github.com/nikic/PHP-Parser/archive/v$version.tar.gz", $exit);
if ($exit !== 0) {
+ passthru("curl -LO https://github.com/nikic/PHP-Parser/archive/v$version.tar.gz", $exit);
+ }
+ if ($exit !== 0) {
throw new Exception("Failed to download PHP-Parser tarball");
}
if (!mkdir($phpParserDir)) {