mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-09 01:45:36 +08:00
cs fixes
This commit is contained in:
@@ -11,25 +11,10 @@ use SPC\store\LockFile;
|
||||
|
||||
class Zig extends CustomPackage
|
||||
{
|
||||
private static function getPath(): string
|
||||
{
|
||||
$arch = arch2gnu(php_uname('m'));
|
||||
$os = match (PHP_OS_FAMILY) {
|
||||
'Linux' => 'linux',
|
||||
'Windows' => 'win',
|
||||
'Darwin' => 'macos',
|
||||
'BSD' => 'freebsd',
|
||||
default => 'linux',
|
||||
};
|
||||
|
||||
$packageName = "zig-{$arch}-{$os}";
|
||||
return PKG_ROOT_PATH . "/{$packageName}";
|
||||
}
|
||||
|
||||
public static function isInstalled(): bool
|
||||
{
|
||||
$path = self::getPath();
|
||||
return file_exists("$path/zig") && file_exists("$path/zig-cc") && file_exists("$path/zig-c++");
|
||||
return file_exists("{$path}/zig") && file_exists("{$path}/zig-cc") && file_exists("{$path}/zig-c++");
|
||||
}
|
||||
|
||||
public function getSupportName(): array
|
||||
@@ -149,6 +134,21 @@ class Zig extends CustomPackage
|
||||
];
|
||||
}
|
||||
|
||||
private static function getPath(): string
|
||||
{
|
||||
$arch = arch2gnu(php_uname('m'));
|
||||
$os = match (PHP_OS_FAMILY) {
|
||||
'Linux' => 'linux',
|
||||
'Windows' => 'win',
|
||||
'Darwin' => 'macos',
|
||||
'BSD' => 'freebsd',
|
||||
default => 'linux',
|
||||
};
|
||||
|
||||
$packageName = "zig-{$arch}-{$os}";
|
||||
return PKG_ROOT_PATH . "/{$packageName}";
|
||||
}
|
||||
|
||||
private function createZigCcScript(string $bin_dir): void
|
||||
{
|
||||
$script_path = __DIR__ . '/../scripts/zig-cc.sh';
|
||||
|
||||
Reference in New Issue
Block a user