From 4293e95664967686688f9351001b998b8a290bb8 Mon Sep 17 00:00:00 2001 From: tianfenghan Date: Tue, 28 Apr 2026 18:51:40 +0800 Subject: [PATCH] =?UTF-8?q?fix(build):=20=E4=BF=AE=E5=A4=8DPHP=E6=89=A9?= =?UTF-8?q?=E5=B1=95=E6=96=87=E4=BB=B6=E8=B7=AF=E5=BE=84=E6=A3=80=E6=9F=A5?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 移除了文件扩展名前的多余点号 - 使用动态扩展名变量构建正确的文件路径 - 更新错误消息以反映正确的文件名格式 - 修正了libphp和libphpx文件的路径验证逻辑 --- src/Php/Translator.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Php/Translator.php b/src/Php/Translator.php index 791bb4db..47e87121 100644 --- a/src/Php/Translator.php +++ b/src/Php/Translator.php @@ -218,12 +218,12 @@ class Translator extends Preprocessor $this->error('The `php-config` is not found'); } $phpDir = trim($phpDir); - $ext = $this->isMacos() ? '.dylib' : '.so'; - if (!is_file($phpDir . '/lib/libphp' . $ext)) { - $this->error('The `libphp.so` is not found, please run `make` to build it'); + $ext = $this->isMacos() ? 'dylib' : 'so'; + if (!is_file($phpDir . '/lib/libphp.' . $ext)) { + $this->error("The `libphp.{$ext}` is not found, please run `make` to build it"); } - if (!is_file($this->getPhpxDir() . '/lib/libphpx' . $ext)) { - $this->error('The `libphpx.so` is not found, please run `make` to build it'); + if (!is_file($this->getPhpxDir() . '/lib/libphpx.' . $ext)) { + $this->error("The `libphpx.{$ext}` is not found, please run `make` to build it"); } $clangFormatVersion = shell_exec('clang-format --version');