mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-17 20:34:51 +08:00
fix: throw if the PHP version doesn't exist
This commit is contained in:
parent
dc12d4d982
commit
bcf64cbeef
@ -35,6 +35,10 @@ class PhpSource extends CustomSourceBase
|
||||
{
|
||||
// 查找最新的小版本号
|
||||
$info = json_decode(Downloader::curlExec(url: "https://www.php.net/releases/index.php?json&version={$major_version}"), true);
|
||||
if (!isset($info['version'])) {
|
||||
throw new DownloaderException("Version {$major_version} not found.");
|
||||
}
|
||||
|
||||
$version = $info['version'];
|
||||
|
||||
// 从官网直接下载
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user