mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-06 16:25:39 +08:00
Merge branch 'main' into feat/xdebug-dynamic
This commit is contained in:
@@ -69,14 +69,19 @@ class Downloader
|
||||
retry: self::getRetryTime()
|
||||
), true);
|
||||
|
||||
if (($source['prefer-stable'] ?? false) === false) {
|
||||
$url = $data[0]['tarball_url'];
|
||||
} else {
|
||||
$id = 0;
|
||||
while (($data[$id]['prerelease'] ?? false) === true) {
|
||||
++$id;
|
||||
$url = null;
|
||||
for ($i = 0; $i < count($data); ++$i) {
|
||||
if (($data[$i]['prerelease'] ?? false) === true && ($source['prefer-stable'] ?? false)) {
|
||||
continue;
|
||||
}
|
||||
if (!($source['match'] ?? null)) {
|
||||
$url = $data[$i]['tarball_url'] ?? null;
|
||||
break;
|
||||
}
|
||||
if (preg_match('|' . $source['match'] . '|', $data[$i]['tarball_url'])) {
|
||||
$url = $data[$i]['tarball_url'];
|
||||
break;
|
||||
}
|
||||
$url = $data[$id]['tarball_url'] ?? null;
|
||||
}
|
||||
if (!$url) {
|
||||
throw new DownloaderException("failed to find {$name} source");
|
||||
|
||||
Reference in New Issue
Block a user