Skip to content

Commit 9c02c58

Browse files
stephenreaynikic
authored andcommitted
Fallback to curl in gen_stub if wget fails
Closes GH-4502.
1 parent 17987da commit 9c02c58

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

scripts/dev/gen_stub.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,11 @@ function initPhpParser() {
384384
if (!is_dir($phpParserDir)) {
385385
$cwd = getcwd();
386386
chdir(__DIR__);
387+
387388
passthru("wget https://github.com/nikic/PHP-Parser/archive/v$version.tar.gz", $exit);
389+
if ($exit !== 0) {
390+
passthru("curl -LO https://github.com/nikic/PHP-Parser/archive/v$version.tar.gz", $exit);
391+
}
388392
if ($exit !== 0) {
389393
throw new Exception("Failed to download PHP-Parser tarball");
390394
}

0 commit comments

Comments
 (0)