From b7b0949625a7d10b07838b87667e05ca47972667 Mon Sep 17 00:00:00 2001 From: crazywhalecc Date: Mon, 9 Sep 2024 16:55:17 +0800 Subject: [PATCH] Update redis to 6.0.2, add alternative license file searcher --- config/source.json | 7 +++++-- src/SPC/ConsoleApplication.php | 2 +- src/SPC/util/LicenseDumper.php | 14 ++++++++++---- src/globals/test-extensions.php | 6 +++--- 4 files changed, 19 insertions(+), 10 deletions(-) diff --git a/config/source.json b/config/source.json index 5a13aacd..e92a7daf 100644 --- a/config/source.json +++ b/config/source.json @@ -649,11 +649,14 @@ "redis": { "type": "git", "path": "php-src/ext/redis", - "rev": "5.3.7", + "rev": "release/6.0.2", "url": "https://github.com/phpredis/phpredis", "license": { "type": "file", - "path": "COPYING" + "path": [ + "LICENSE", + "COPYING" + ] } }, "snappy": { diff --git a/src/SPC/ConsoleApplication.php b/src/SPC/ConsoleApplication.php index 64048cf6..534cbe03 100644 --- a/src/SPC/ConsoleApplication.php +++ b/src/SPC/ConsoleApplication.php @@ -30,7 +30,7 @@ use Symfony\Component\Console\Application; */ final class ConsoleApplication extends Application { - public const VERSION = '2.3.3'; + public const VERSION = '2.3.4'; public function __construct() { diff --git a/src/SPC/util/LicenseDumper.php b/src/SPC/util/LicenseDumper.php index 42ae6746..69f21199 100644 --- a/src/SPC/util/LicenseDumper.php +++ b/src/SPC/util/LicenseDumper.php @@ -118,20 +118,26 @@ class LicenseDumper /** * @throws RuntimeException */ - private function loadSourceFile(string $source_name, int $index, ?string $in_path, ?string $custom_base_path = null): string + private function loadSourceFile(string $source_name, int $index, null|array|string $in_path, ?string $custom_base_path = null): string { if (is_null($in_path)) { throw new RuntimeException('source [' . $source_name . '] license file is not set, please check config/source.json'); } - if (file_exists(SOURCE_PATH . '/' . ($custom_base_path ?? $source_name) . '/' . $in_path)) { - return file_get_contents(SOURCE_PATH . '/' . ($custom_base_path ?? $source_name) . '/' . $in_path); + if (!is_array($in_path)) { + $in_path = [$in_path]; + } + + foreach ($in_path as $item) { + if (file_exists(SOURCE_PATH . '/' . ($custom_base_path ?? $source_name) . '/' . $item)) { + return file_get_contents(SOURCE_PATH . '/' . ($custom_base_path ?? $source_name) . '/' . $item); + } } if (file_exists(BUILD_ROOT_PATH . '/source-licenses/' . $source_name . '/' . $index . '.txt')) { return file_get_contents(BUILD_ROOT_PATH . '/source-licenses/' . $source_name . '/' . $index . '.txt'); } - throw new RuntimeException('source [' . $source_name . '] license file [' . $in_path . '] not exist'); + throw new RuntimeException('Cannot find any license file in source [' . $source_name . '] directory!'); } } diff --git a/src/globals/test-extensions.php b/src/globals/test-extensions.php index 645d555f..cb537a11 100644 --- a/src/globals/test-extensions.php +++ b/src/globals/test-extensions.php @@ -19,13 +19,13 @@ $upx = true; // If you want to test your added extensions and libs, add below (comma separated, example `bcmath,openssl`). $extensions = match (PHP_OS_FAMILY) { - 'Linux', 'Darwin' => 'imap,swoole-hook-sqlite,swoole', - 'Windows' => 'igbinary,redis,session', + 'Linux', 'Darwin' => 'redis,igbinary', + 'Windows' => 'redis,igbinary', }; // If you want to test lib-suggests feature with extension, add them below (comma separated, example `libwebp,libavif`). $with_libs = match (PHP_OS_FAMILY) { - 'Linux', 'Darwin' => '', + 'Linux', 'Darwin' => 'liblz4', 'Windows' => '', };