mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-12 03:15:35 +08:00
cs fix
This commit is contained in:
@@ -94,5 +94,4 @@ class GoXcaddy extends CustomPackage
|
|||||||
'GOPATH' => "{$pkgroot}/go",
|
'GOPATH' => "{$pkgroot}/go",
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -104,15 +104,32 @@ class Zig extends CustomPackage
|
|||||||
$filename = DOWNLOAD_PATH . '/' . ($lock[$name]['filename'] ?? $lock[$name]['dirname']);
|
$filename = DOWNLOAD_PATH . '/' . ($lock[$name]['filename'] ?? $lock[$name]['dirname']);
|
||||||
$extract = "{$pkgroot}/{$name}";
|
$extract = "{$pkgroot}/{$name}";
|
||||||
|
|
||||||
|
|
||||||
FileSystem::extractPackage($name, $source_type, $filename, $extract);
|
FileSystem::extractPackage($name, $source_type, $filename, $extract);
|
||||||
|
|
||||||
$this->createZigCcScript($zig_bin_dir);
|
$this->createZigCcScript($zig_bin_dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function getEnvironment(): array
|
||||||
|
{
|
||||||
|
$arch = arch2gnu(php_uname('m'));
|
||||||
|
$os = match (PHP_OS_FAMILY) {
|
||||||
|
'Linux' => 'linux',
|
||||||
|
'Windows' => 'win',
|
||||||
|
'Darwin' => 'macos',
|
||||||
|
'BSD' => 'freebsd',
|
||||||
|
default => 'linux',
|
||||||
|
};
|
||||||
|
|
||||||
|
$packageName = "zig-{$arch}-{$os}";
|
||||||
|
$path = PKG_ROOT_PATH . "/{$packageName}";
|
||||||
|
|
||||||
|
return [
|
||||||
|
'PATH' => $path,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
private function createZigCcScript(string $bin_dir): void
|
private function createZigCcScript(string $bin_dir): void
|
||||||
{
|
{
|
||||||
|
|
||||||
$script_content = <<<'EOF'
|
$script_content = <<<'EOF'
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
@@ -202,23 +219,4 @@ EOF;
|
|||||||
file_put_contents("{$bin_dir}/zig-c++", $script_content);
|
file_put_contents("{$bin_dir}/zig-c++", $script_content);
|
||||||
chmod("{$bin_dir}/zig-c++", 0755);
|
chmod("{$bin_dir}/zig-c++", 0755);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getEnvironment(): array
|
|
||||||
{
|
|
||||||
$arch = arch2gnu(php_uname('m'));
|
|
||||||
$os = match (PHP_OS_FAMILY) {
|
|
||||||
'Linux' => 'linux',
|
|
||||||
'Windows' => 'win',
|
|
||||||
'Darwin' => 'macos',
|
|
||||||
'BSD' => 'freebsd',
|
|
||||||
default => 'linux',
|
|
||||||
};
|
|
||||||
|
|
||||||
$packageName = "zig-{$arch}-{$os}";
|
|
||||||
$path = PKG_ROOT_PATH . "/{$packageName}";
|
|
||||||
|
|
||||||
return [
|
|
||||||
'PATH' => $path
|
|
||||||
];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user