mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-17 20:34:51 +08:00
rename go-mod-frankenphp to go-xcaddy
This commit is contained in:
parent
a0047e3ad7
commit
fbd6360bda
@ -43,16 +43,16 @@
|
||||
"upx-*-win64/upx.exe": "{pkg_root_path}/bin/upx.exe"
|
||||
}
|
||||
},
|
||||
"go-mod-frankenphp-x86_64-linux": {
|
||||
"go-xcaddy-x86_64-linux": {
|
||||
"type": "custom"
|
||||
},
|
||||
"go-mod-frankenphp-aarch64-linux": {
|
||||
"go-xcaddy-aarch64-linux": {
|
||||
"type": "custom"
|
||||
},
|
||||
"go-mod-frankenphp-x86_64-macos": {
|
||||
"go-xcaddy-x86_64-macos": {
|
||||
"type": "custom"
|
||||
},
|
||||
"go-mod-frankenphp-aarch64-macos": {
|
||||
"go-xcaddy-aarch64-macos": {
|
||||
"type": "custom"
|
||||
}
|
||||
}
|
||||
|
||||
@ -520,11 +520,11 @@ abstract class BuilderBase
|
||||
if (!in_array(PHP_OS_FAMILY, ['Linux', 'Darwin'])) {
|
||||
throw new WrongUsageException('FrankenPHP SAPI is only available on Linux and macOS!');
|
||||
}
|
||||
// frankenphp needs package go-mod-frankenphp installed
|
||||
$pkg_dir = PKG_ROOT_PATH . '/go-mod-frankenphp-' . arch2gnu(php_uname('m')) . '-' . osfamily2shortname();
|
||||
// frankenphp needs package go-xcaddy installed
|
||||
$pkg_dir = PKG_ROOT_PATH . '/go-xcaddy-' . arch2gnu(php_uname('m')) . '-' . osfamily2shortname();
|
||||
if (!file_exists("{$pkg_dir}/bin/go") || !file_exists("{$pkg_dir}/bin/xcaddy")) {
|
||||
global $argv;
|
||||
throw new WrongUsageException("FrankenPHP SAPI requires go-mod-frankenphp package, please install it first: {$argv[0]} install-pkg go-mod-frankenphp");
|
||||
throw new WrongUsageException("FrankenPHP SAPI requires the go-xcaddy package, please install it first: {$argv[0]} install-pkg go-xcaddy");
|
||||
}
|
||||
// frankenphp needs libxml2 lib on macos, see: https://github.com/php/frankenphp/blob/main/frankenphp.go#L17
|
||||
if (PHP_OS_FAMILY === 'Darwin' && !$this->getLib('libxml2')) {
|
||||
|
||||
@ -311,7 +311,7 @@ abstract class UnixBuilderBase extends BuilderBase
|
||||
$arch = arch2gnu(php_uname('m'));
|
||||
|
||||
// define executables for go and xcaddy
|
||||
$xcaddy_exec = PKG_ROOT_PATH . "/go-mod-frankenphp-{$arch}-{$os}/bin/xcaddy";
|
||||
$xcaddy_exec = PKG_ROOT_PATH . "/go-xcaddy-{$arch}-{$os}/bin/xcaddy";
|
||||
|
||||
$nobrotli = $this->getLib('brotli') === null ? ',nobrotli' : '';
|
||||
$nowatcher = $this->getLib('watcher') === null ? ',nowatcher' : '';
|
||||
@ -342,9 +342,9 @@ abstract class UnixBuilderBase extends BuilderBase
|
||||
$config = (new SPCConfigUtil($this))->config($this->ext_list, $this->lib_list, with_dependencies: true);
|
||||
|
||||
$env = [
|
||||
'PATH' => PKG_ROOT_PATH . "/go-mod-frankenphp-{$arch}-{$os}/bin:" . getenv('PATH'),
|
||||
'GOROOT' => PKG_ROOT_PATH . "/go-mod-frankenphp-{$arch}-{$os}",
|
||||
'GOBIN' => PKG_ROOT_PATH . "/go-mod-frankenphp-{$arch}-{$os}/bin",
|
||||
'PATH' => PKG_ROOT_PATH . "/go-xcaddy-{$arch}-{$os}/bin:" . getenv('PATH'),
|
||||
'GOROOT' => PKG_ROOT_PATH . "/go-xcaddy-{$arch}-{$os}",
|
||||
'GOBIN' => PKG_ROOT_PATH . "/go-xcaddy-{$arch}-{$os}/bin",
|
||||
'GOPATH' => PKG_ROOT_PATH . '/go',
|
||||
'CGO_ENABLED' => '1',
|
||||
'CGO_CFLAGS' => $config['cflags'],
|
||||
|
||||
@ -68,10 +68,10 @@ class CraftCommand extends BaseCommand
|
||||
}
|
||||
// install go and xcaddy for frankenphp
|
||||
if (in_array('frankenphp', $craft['sapi'])) {
|
||||
$retcode = $this->runCommand('install-pkg', 'go-mod-frankenphp');
|
||||
$retcode = $this->runCommand('install-pkg', 'go-xcaddy');
|
||||
if ($retcode !== 0) {
|
||||
$this->output->writeln('<error>craft go-mod-frankenphp failed</error>');
|
||||
$this->log("craft go-mod-frankenphp failed with code: {$retcode}", true);
|
||||
$this->output->writeln('<error>craft go-xcaddy failed</error>');
|
||||
$this->log("craft go-xcaddy failed with code: {$retcode}", true);
|
||||
return static::FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
@ -9,15 +9,15 @@ use SPC\store\FileSystem;
|
||||
use SPC\store\LockFile;
|
||||
use SPC\util\GlobalEnvManager;
|
||||
|
||||
class GoModFrankenphp extends CustomPackage
|
||||
class GoXcaddy extends CustomPackage
|
||||
{
|
||||
public function getSupportName(): array
|
||||
{
|
||||
return [
|
||||
'go-mod-frankenphp-x86_64-linux',
|
||||
'go-mod-frankenphp-x86_64-macos',
|
||||
'go-mod-frankenphp-aarch64-linux',
|
||||
'go-mod-frankenphp-aarch64-macos',
|
||||
'go-xcaddy-x86_64-linux',
|
||||
'go-xcaddy-x86_64-macos',
|
||||
'go-xcaddy-aarch64-linux',
|
||||
'go-xcaddy-aarch64-macos',
|
||||
];
|
||||
}
|
||||
|
||||
@ -212,7 +212,7 @@ switch ($argv[1] ?? null) {
|
||||
break;
|
||||
case 'build_embed_cmd':
|
||||
if ($frankenphp) {
|
||||
passthru("{$prefix}install-pkg go-mod-frankenphp --debug", $retcode);
|
||||
passthru("{$prefix}install-pkg go-xcaddy --debug", $retcode);
|
||||
if ($retcode !== 0) {
|
||||
break;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user