Compare commits

...

4 Commits

Author SHA1 Message Date
Kévin Dunglas
bcf64cbeef fix: throw if the PHP version doesn't exist 2023-08-26 13:58:09 +08:00
Kévin Dunglas
dc12d4d982 fix: ExceptionHandler:: must not be accessed before initialization 2023-08-26 13:57:43 +08:00
Kévin Dunglas
42e5877a7f fix: check of xz 2023-08-26 13:57:18 +08:00
Kévin Dunglas
a8924ac4fe fix: setup-runtime portability 2023-08-26 13:53:52 +08:00
4 changed files with 8 additions and 3 deletions

View File

@ -52,7 +52,7 @@ china)
esac
if ! command -v curl &> /dev/null && command -v apk &> /dev/null; then
if ! command -v curl > /dev/null && command -v apk > /dev/null; then
apk add --no-cache curl
fi

View File

@ -28,6 +28,7 @@ class LinuxToolCheckList
'git', 'autoconf', 'automake',
'tar', 'unzip', 'gzip',
'bzip2', 'cmake', 'patch',
'xz',
];
/** @noinspection PhpUnused */
@ -87,7 +88,7 @@ class LinuxToolCheckList
logger()->warning('Current user is not root, using sudo for running command');
}
try {
shell(true)->exec($prefix . $install_cmd . ' ' . implode(' ', $missing));
shell(true)->exec($prefix . $install_cmd . ' ' . implode(' ', str_replace('xz', 'xz-utils', $missing)));
} catch (RuntimeException) {
return false;
}

View File

@ -6,7 +6,7 @@ namespace SPC\exception;
class ExceptionHandler
{
protected mixed $whoops;
protected mixed $whoops = null;
private static ?ExceptionHandler $obj = null;

View File

@ -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'];
// 从官网直接下载