fix(build): 修复PHP扩展文件路径检查逻辑

- 移除了文件扩展名前的多余点号
- 使用动态扩展名变量构建正确的文件路径
- 更新错误消息以反映正确的文件名格式
- 修正了libphp和libphpx文件的路径验证逻辑
pull/1/head
韩天峰 4 months ago
parent 0fb8957fc7
commit 4293e95664
  1. 10
      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');

Loading…
Cancel
Save