mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 04:44:53 +08:00
patch frankenphp build for new xcaddy release
This commit is contained in:
parent
df0807f07c
commit
823b26fbb9
@ -411,10 +411,17 @@ abstract class UnixBuilderBase extends BuilderBase
|
|||||||
$nowatcher = $this->getLib('watcher') === null ? ',nowatcher' : '';
|
$nowatcher = $this->getLib('watcher') === null ? ',nowatcher' : '';
|
||||||
$xcaddyModules = getenv('SPC_CMD_VAR_FRANKENPHP_XCADDY_MODULES');
|
$xcaddyModules = getenv('SPC_CMD_VAR_FRANKENPHP_XCADDY_MODULES');
|
||||||
$frankenphpSourceDir = getenv('FRANKENPHP_SOURCE_PATH') ?: SOURCE_PATH . '/frankenphp';
|
$frankenphpSourceDir = getenv('FRANKENPHP_SOURCE_PATH') ?: SOURCE_PATH . '/frankenphp';
|
||||||
|
FileSystem::replaceFileStr(
|
||||||
|
$frankenphpSourceDir . '/caddy/php-server.go',
|
||||||
|
'config, _, err := caddycmd.LoadConfig',
|
||||||
|
'config, _, _, err := caddycmd.LoadConfig'
|
||||||
|
);
|
||||||
|
|
||||||
$xcaddyModules = preg_replace('#--with github.com/dunglas/frankenphp\S*#', '', $xcaddyModules);
|
$xcaddyModules = preg_replace('#--with github.com/dunglas/frankenphp\S*#', '', $xcaddyModules);
|
||||||
$xcaddyModules = "--with github.com/dunglas/frankenphp={$frankenphpSourceDir} " .
|
$xcaddyModules = "--with github.com/dunglas/frankenphp={$frankenphpSourceDir} " .
|
||||||
"--with github.com/dunglas/frankenphp/caddy={$frankenphpSourceDir}/caddy {$xcaddyModules}";
|
"--with github.com/dunglas/frankenphp/caddy={$frankenphpSourceDir}/caddy " .
|
||||||
|
"--with github.com/caddyserver/caddy/v2=github.com/henderkes/caddy/v2@master " .
|
||||||
|
"{$xcaddyModules}";
|
||||||
if ($this->getLib('brotli') === null && str_contains($xcaddyModules, '--with github.com/dunglas/caddy-cbrotli')) {
|
if ($this->getLib('brotli') === null && str_contains($xcaddyModules, '--with github.com/dunglas/caddy-cbrotli')) {
|
||||||
logger()->warning('caddy-cbrotli module is enabled, but brotli library is not built. Disabling caddy-cbrotli.');
|
logger()->warning('caddy-cbrotli module is enabled, but brotli library is not built. Disabling caddy-cbrotli.');
|
||||||
$xcaddyModules = str_replace('--with github.com/dunglas/caddy-cbrotli', '', $xcaddyModules);
|
$xcaddyModules = str_replace('--with github.com/dunglas/caddy-cbrotli', '', $xcaddyModules);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user