'string', 'path' => 'string', 'rev' => 'string', 'url' => 'string'])] public function getLatestPHPInfo(string $major_version): array { // 查找最新的小版本号 $info = json_decode(Downloader::curlExec( url: "https://www.php.net/releases/index.php?json&version={$major_version}", retries: intval(getenv('SPC_DOWNLOAD_RETRIES') ?: 0) ), true); if (!isset($info['version'])) { throw new DownloaderException("Version {$major_version} not found."); } $version = $info['version']; // 从官网直接下载 return [ 'type' => 'url', 'url' => "https://www.php.net/distributions/php-{$version}.tar.xz", ]; } }