]> granicus.if.org Git - php/commitdiff
Fallback to curl in gen_stub if wget fails
authorStephen Reay <stephen.reay@me.com>
Sat, 10 Aug 2019 13:10:16 +0000 (20:10 +0700)
committerNikita Popov <nikita.ppv@gmail.com>
Sat, 10 Aug 2019 14:21:03 +0000 (16:21 +0200)
Closes GH-4502.

scripts/dev/gen_stub.php

index 993be075d7f51a217ff9fa0f449f2ab75a17e4de..f61893050c49fce700687702e05f41e588586147 100755 (executable)
@@ -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");
         }