mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-21 07:45:36 +08:00
Disallow alt for php-src
This commit is contained in:
@@ -4,7 +4,8 @@
|
|||||||
"license": {
|
"license": {
|
||||||
"type": "file",
|
"type": "file",
|
||||||
"path": "LICENSE"
|
"path": "LICENSE"
|
||||||
}
|
},
|
||||||
|
"alt": false
|
||||||
},
|
},
|
||||||
"amqp": {
|
"amqp": {
|
||||||
"type": "url",
|
"type": "url",
|
||||||
|
|||||||
@@ -245,11 +245,15 @@ class DownloadCommand extends BaseCommand
|
|||||||
}
|
}
|
||||||
// if download failed, we will try to download alternative sources
|
// if download failed, we will try to download alternative sources
|
||||||
logger()->warning("Download failed: {$e->getMessage()}");
|
logger()->warning("Download failed: {$e->getMessage()}");
|
||||||
logger()->notice("Trying to download alternative sources for {$source}");
|
|
||||||
$alt_sources = Config::getSource($source)['alt'] ?? null;
|
$alt_sources = Config::getSource($source)['alt'] ?? null;
|
||||||
if ($alt_sources === 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));
|
$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);
|
$alt_config = array_merge($config, $alt_sources);
|
||||||
}
|
}
|
||||||
Downloader::downloadSource($source, $alt_config, $force_all || in_array($source, $force_list));
|
Downloader::downloadSource($source, $alt_config, $force_all || in_array($source, $force_list));
|
||||||
|
|||||||
Reference in New Issue
Block a user