From 2b97cee9e026e469efafb49fa3728ab00f41056a Mon Sep 17 00:00:00 2001 From: rango Date: Fri, 8 May 2026 13:27:26 +0800 Subject: [PATCH] =?UTF-8?q?refactor(php):=20=E9=87=8D=E6=9E=84=E5=B9=B3?= =?UTF-8?q?=E5=8F=B0=E6=A3=80=E6=B5=8B=E9=80=BB=E8=BE=91=E7=9A=84=E8=B0=83?= =?UTF-8?q?=E7=94=A8=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将 detectPlatform 方法调用从 CompilerBase 移至 Translator 类中 - 删除 CompilerBase 中已注释的 no-literal-strings 参数处理代码 - 优化代码结构以提高平台检测的执行时机 --- src/Php/CompilerBase.php | 4 ---- src/Php/Translator.php | 4 ++++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Php/CompilerBase.php b/src/Php/CompilerBase.php index 9bb049ba..021d688d 100644 --- a/src/Php/CompilerBase.php +++ b/src/Php/CompilerBase.php @@ -300,10 +300,6 @@ class CompilerBase extends \PhpAot\Core\Translator $this->setBuildDir($rootPath . '/build'); $climate = new CLImate(); $this->climate = $climate; - // $this->noLiteralStrings = $climate->arguments->get('no-literal-strings'); - - // 检测操作系统、编译器以及 Windows 平台的 PHP lib 文件 - $this->detectPlatform(); } /** diff --git a/src/Php/Translator.php b/src/Php/Translator.php index fb4ce92e..40463a2d 100644 --- a/src/Php/Translator.php +++ b/src/Php/Translator.php @@ -68,6 +68,10 @@ class Translator extends Preprocessor $this->showVersion(); exit(0); } + + + // 检测操作系统、编译器以及 Windows 平台的 PHP lib 文件 + $this->detectPlatform(); } public function showUsage(): void