From 61a76dc0c9baa4f3291bee39f7d0e2a4d23a0b38 Mon Sep 17 00:00:00 2001 From: crazywhalecc Date: Sat, 22 Apr 2023 15:58:24 +0800 Subject: [PATCH] set php 7.4 patch alternative --- src/SPC/command/FetchSourceCommand.php | 7 ++++--- src/SPC/util/Util.php | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 src/SPC/util/Util.php diff --git a/src/SPC/command/FetchSourceCommand.php b/src/SPC/command/FetchSourceCommand.php index e2d340e9..131efa71 100644 --- a/src/SPC/command/FetchSourceCommand.php +++ b/src/SPC/command/FetchSourceCommand.php @@ -12,6 +12,7 @@ use SPC\exception\RuntimeException; use SPC\store\Config; use SPC\store\Downloader; use SPC\util\Patcher; +use SPC\util\Util; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; @@ -214,11 +215,11 @@ class FetchSourceCommand extends BaseCommand private function doPatch(): void { // swow 需要软链接内部的文件夹才能正常编译 - if (!file_exists(SOURCE_PATH . '/php-src/ext/swow')) { + if (!file_exists(SOURCE_PATH . '/php-src/ext/swow') && Util::getPHPVersionID() >= 80000) { Patcher::patchSwow(); + // patch 一些 PHP 的资源,以便编译 + Patcher::patchMicroThings(); } - // patch 一些 PHP 的资源,以便编译 - Patcher::patchPHPDepFiles(); // openssl 3 需要 patch 额外的东西 if (!$this->input->getOption('with-openssl11') && $this->php_major_ver === '8.0') { diff --git a/src/SPC/util/Util.php b/src/SPC/util/Util.php new file mode 100644 index 00000000..ff017527 --- /dev/null +++ b/src/SPC/util/Util.php @@ -0,0 +1,18 @@ +