From: Stephen Reay Date: Sat, 10 Aug 2019 13:10:16 +0000 (+0700) Subject: Fallback to curl in gen_stub if wget fails X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9c02c584819369b7e1fd1ab515a2e5c411355b11;p=php Fallback to curl in gen_stub if wget fails Closes GH-4502. --- 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,7 +384,11 @@ 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"); }