Disallow alt for php-src

This commit is contained in:
crazywhalecc
2025-07-17 12:21:50 +08:00
parent 83db186972
commit c604f88685
2 changed files with 8 additions and 3 deletions

View File

@@ -4,7 +4,8 @@
"license": {
"type": "file",
"path": "LICENSE"
}
},
"alt": false
},
"amqp": {
"type": "url",

View File

@@ -245,11 +245,15 @@ class DownloadCommand extends BaseCommand
}
// if download failed, we will try to download alternative sources
logger()->warning("Download failed: {$e->getMessage()}");
logger()->notice("Trying to download alternative sources for {$source}");
$alt_sources = Config::getSource($source)['alt'] ?? null;
if ($alt_sources === null) {
logger()->warning("No alternative sources found for {$source}, using default alternative source");
$alt_config = array_merge($config, $this->getDefaultAlternativeSource($source));
} else {
} elseif ($alt_sources === false) {
logger()->warning("No alternative sources found for {$source}, skipping alternative download");
throw $e;
} else{
logger()->notice("Trying to download alternative sources for {$source}");
$alt_config = array_merge($config, $alt_sources);
}
Downloader::downloadSource($source, $alt_config, $force_all || in_array($source, $force_list));