mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 04:44:53 +08:00
Compare commits
4 Commits
7fb27c0c29
...
bcf64cbeef
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bcf64cbeef | ||
|
|
dc12d4d982 | ||
|
|
42e5877a7f | ||
|
|
a8924ac4fe |
@ -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
|
||||
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -6,7 +6,7 @@ namespace SPC\exception;
|
||||
|
||||
class ExceptionHandler
|
||||
{
|
||||
protected mixed $whoops;
|
||||
protected mixed $whoops = null;
|
||||
|
||||
private static ?ExceptionHandler $obj = null;
|
||||
|
||||
|
||||
@ -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