mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 12:54:52 +08:00
isInstalled for GoXcaddy
This commit is contained in:
parent
a483c42893
commit
292df38c10
@ -10,6 +10,23 @@ use SPC\store\LockFile;
|
|||||||
|
|
||||||
class GoXcaddy extends CustomPackage
|
class GoXcaddy extends CustomPackage
|
||||||
{
|
{
|
||||||
|
public static function isInstalled(): bool
|
||||||
|
{
|
||||||
|
$arch = arch2gnu(php_uname('m'));
|
||||||
|
$os = match (PHP_OS_FAMILY) {
|
||||||
|
'Windows' => 'win',
|
||||||
|
'Darwin' => 'macos',
|
||||||
|
'BSD' => 'freebsd',
|
||||||
|
default => 'linux',
|
||||||
|
};
|
||||||
|
|
||||||
|
$packageName = "go-xcaddy-{$arch}-{$os}";
|
||||||
|
$pkgroot = PKG_ROOT_PATH;
|
||||||
|
$folder = "{$pkgroot}/{$packageName}";
|
||||||
|
|
||||||
|
return is_dir($folder) && is_file("{$folder}/bin/go") && is_file("{$folder}/bin/xcaddy");
|
||||||
|
}
|
||||||
|
|
||||||
public function getSupportName(): array
|
public function getSupportName(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user