mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 12:54:52 +08:00
separate system tools list
This commit is contained in:
parent
08efc81cf0
commit
1912ae36e6
@ -15,25 +15,29 @@ class LinuxToolCheckList
|
|||||||
{
|
{
|
||||||
use UnixSystemUtilTrait;
|
use UnixSystemUtilTrait;
|
||||||
|
|
||||||
|
public const TOOLS_ALPINE = [
|
||||||
|
'make', 'bison', 'flex',
|
||||||
|
'git', 'autoconf', 'automake',
|
||||||
|
'tar', 'unzip', 'gzip',
|
||||||
|
'bzip2', 'cmake', 'gcc',
|
||||||
|
'g++', 'patch',
|
||||||
|
];
|
||||||
|
|
||||||
|
public const TOOLS_DEBIAN = [
|
||||||
|
'make', 'bison', 'flex',
|
||||||
|
'git', 'autoconf', 'automake',
|
||||||
|
'tar', 'unzip', 'gzip',
|
||||||
|
'bzip2', 'cmake', 'patch',
|
||||||
|
];
|
||||||
|
|
||||||
#[AsCheckItem('if necessary tools are installed', limit_os: 'Linux')]
|
#[AsCheckItem('if necessary tools are installed', limit_os: 'Linux')]
|
||||||
public function checkCliTools(): ?CheckResult
|
public function checkCliTools(): ?CheckResult
|
||||||
{
|
{
|
||||||
$distro = SystemUtil::getOSRelease();
|
$distro = SystemUtil::getOSRelease();
|
||||||
|
|
||||||
$required = match ($distro['dist']) {
|
$required = match ($distro['dist']) {
|
||||||
'alpine' => [
|
'alpine' => self::TOOLS_ALPINE,
|
||||||
'make', 'bison', 'flex',
|
default => self::TOOLS_DEBIAN,
|
||||||
'git', 'autoconf', 'automake',
|
|
||||||
'tar', 'unzip', 'gzip',
|
|
||||||
'bzip2', 'cmake', 'gcc',
|
|
||||||
'g++', 'patch',
|
|
||||||
],
|
|
||||||
default => [
|
|
||||||
'make', 'bison', 'flex',
|
|
||||||
'git', 'autoconf', 'automake',
|
|
||||||
'tar', 'unzip', 'gzip',
|
|
||||||
'bzip2', 'cmake', 'patch',
|
|
||||||
],
|
|
||||||
};
|
};
|
||||||
$missing = [];
|
$missing = [];
|
||||||
foreach ($required as $cmd) {
|
foreach ($required as $cmd) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user