From cf30418be970496093ece61fab939c590774d2f2 Mon Sep 17 00:00:00 2001 From: Jerry Ma Date: Fri, 7 Mar 2025 18:25:19 +0800 Subject: [PATCH] Remove deprecated args for PHP 8.4 (#616) * Remove deprecated args for PHP 8.4 * Add tests * Use nts for testing * Test * memcache still uses `--with-zlib-dir` --- config/ext.json | 4 +--- src/SPC/builder/extension/memcached.php | 3 ++- src/SPC/builder/extension/openssl.php | 3 ++- src/SPC/builder/extension/zlib.php | 6 ++---- src/globals/test-extensions.php | 6 ++---- 5 files changed, 9 insertions(+), 13 deletions(-) diff --git a/config/ext.json b/config/ext.json index 325e40d0..5d5aee50 100644 --- a/config/ext.json +++ b/config/ext.json @@ -355,10 +355,8 @@ "type": "external", "source": "ext-memcache", "arg-type": "custom", - "lib-depends": [ - "zlib" - ], "ext-depends": [ + "zlib", "session" ] }, diff --git a/src/SPC/builder/extension/memcached.php b/src/SPC/builder/extension/memcached.php index 49fb228d..1ef679d9 100644 --- a/src/SPC/builder/extension/memcached.php +++ b/src/SPC/builder/extension/memcached.php @@ -13,6 +13,7 @@ class memcached extends Extension public function getUnixConfigureArg(): string { $rootdir = BUILD_ROOT_PATH; - return "--enable-memcached --with-zlib-dir={$rootdir} --with-libmemcached-dir={$rootdir} --disable-memcached-sasl --enable-memcached-json"; + $zlib_dir = $this->builder->getPHPVersionID() >= 80400 ? '' : "--with-zlib-dir={$rootdir}"; + return "--enable-memcached {$zlib_dir} --with-libmemcached-dir={$rootdir} --disable-memcached-sasl --enable-memcached-json"; } } diff --git a/src/SPC/builder/extension/openssl.php b/src/SPC/builder/extension/openssl.php index 13f58c60..2576b0b2 100644 --- a/src/SPC/builder/extension/openssl.php +++ b/src/SPC/builder/extension/openssl.php @@ -25,6 +25,7 @@ class openssl extends Extension public function getUnixConfigureArg(): string { - return '--with-openssl=' . BUILD_ROOT_PATH . ' --with-openssl-dir=' . BUILD_ROOT_PATH; + $openssl_dir = $this->builder->getPHPVersionID() >= 80400 ? '' : ' --with-openssl-dir=' . BUILD_ROOT_PATH; + return '--with-openssl=' . BUILD_ROOT_PATH . $openssl_dir; } } diff --git a/src/SPC/builder/extension/zlib.php b/src/SPC/builder/extension/zlib.php index a4b8d44b..a9932999 100644 --- a/src/SPC/builder/extension/zlib.php +++ b/src/SPC/builder/extension/zlib.php @@ -12,9 +12,7 @@ class zlib extends Extension { public function getUnixConfigureArg(): string { - if ($this->builder->getPHPVersionID() >= 80400) { - return '--with-zlib'; - } - return '--with-zlib --with-zlib-dir="' . BUILD_ROOT_PATH . '"'; + $zlib_dir = $this->builder->getPHPVersionID() >= 80400 ? '' : ' --with-zlib-dir=' . BUILD_ROOT_PATH; + return '--with-zlib' . $zlib_dir; } } diff --git a/src/globals/test-extensions.php b/src/globals/test-extensions.php index 28bfffdc..78c3421a 100644 --- a/src/globals/test-extensions.php +++ b/src/globals/test-extensions.php @@ -13,8 +13,6 @@ declare(strict_types=1); // test php version $test_php_version = [ - '8.1', - '8.2', '8.3', '8.4', ]; @@ -28,7 +26,7 @@ $test_os = [ ]; // whether enable thread safe -$zts = true; +$zts = false; $no_strip = false; @@ -40,7 +38,7 @@ $prefer_pre_built = false; // If you want to test your added extensions and libs, add below (comma separated, example `bcmath,openssl`). $extensions = match (PHP_OS_FAMILY) { - 'Linux', 'Darwin' => 'gettext', + 'Linux', 'Darwin' => 'imap,openssl,zlib,memcache', 'Windows' => 'gettext', };