From e69a56b7c50b89ce8c6dcc40313585f8f3dcab52 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Fri, 26 Jun 2020 07:53:16 +0200 Subject: update to 5.3.0RC1 enable lz4 compression support drop patch merged upstream add upstream patch to fix lz4 library name add new option in provided configuration file --- 1750.patch | 59 -------------------------------------------- PHPINFO | 5 ++-- REFLECTION | 38 ++++++++++++++++++++++++----- php-pecl-redis5.spec | 61 +++++++++++++++++++++++++--------------------- redis-lz4.patch | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 137 insertions(+), 95 deletions(-) delete mode 100644 1750.patch create mode 100644 redis-lz4.patch diff --git a/1750.patch b/1750.patch deleted file mode 100644 index 4c3642e..0000000 --- a/1750.patch +++ /dev/null @@ -1,59 +0,0 @@ -From 2d19ba1d6fe8f0f650d7b9bc02c5f1cb10dbb9e0 Mon Sep 17 00:00:00 2001 -From: Remi Collet -Date: Wed, 6 May 2020 08:54:43 +0200 -Subject: [PATCH] fix [-Wformat=] warning on 32-bit - ---- - cluster_library.c | 2 +- - redis_array.c | 4 ++-- - redis_cluster.c | 2 +- - 3 files changed, 4 insertions(+), 4 deletions(-) - -diff --git a/cluster_library.c b/cluster_library.c -index 191947c57..b21a68758 100644 ---- a/cluster_library.c -+++ b/cluster_library.c -@@ -552,7 +552,7 @@ unsigned short cluster_hash_key_zval(zval *z_key) { - klen = Z_STRLEN_P(z_key); - break; - case IS_LONG: -- klen = snprintf(buf,sizeof(buf),"%ld",Z_LVAL_P(z_key)); -+ klen = snprintf(buf,sizeof(buf),ZEND_LONG_FMT,Z_LVAL_P(z_key)); - kptr = (const char *)buf; - break; - case IS_DOUBLE: -diff --git a/redis_array.c b/redis_array.c -index 7f8fa129d..bdd7120ef 100644 ---- a/redis_array.c -+++ b/redis_array.c -@@ -926,7 +926,7 @@ PHP_METHOD(RedisArray, mget) - key_len = Z_STRLEN_P(data); - key_lookup = Z_STRVAL_P(data); - } else { -- key_len = snprintf(kbuf, sizeof(kbuf), "%ld", Z_LVAL_P(data)); -+ key_len = snprintf(kbuf, sizeof(kbuf), ZEND_LONG_FMT, Z_LVAL_P(data)); - key_lookup = (char*)kbuf; - } - -@@ -1052,7 +1052,7 @@ PHP_METHOD(RedisArray, mset) - key_len = ZSTR_LEN(zkey); - key = ZSTR_VAL(zkey); - } else { -- key_len = snprintf(kbuf, sizeof(kbuf), "%lu", idx); -+ key_len = snprintf(kbuf, sizeof(kbuf), ZEND_ULONG_FMT, idx); - key = kbuf; - } - -diff --git a/redis_cluster.c b/redis_cluster.c -index ee218ba05..7f79b5fe8 100644 ---- a/redis_cluster.c -+++ b/redis_cluster.c -@@ -2245,7 +2245,7 @@ cluster_cmd_get_slot(redisCluster *c, zval *z_arg) - - /* Inform the caller if they've passed bad data */ - if (slot < 0) { -- php_error_docref(0, E_WARNING, "Unknown node %s:%ld", -+ php_error_docref(0, E_WARNING, "Unknown node %s:" ZEND_LONG_FMT, - Z_STRVAL_P(z_host), Z_LVAL_P(z_port)); - } - } else { diff --git a/PHPINFO b/PHPINFO index 90787cf..ead9f0b 100644 --- a/PHPINFO +++ b/PHPINFO @@ -2,10 +2,10 @@ redis Redis Support => enabled -Redis Version => 5.2.2 +Redis Version => 5.3.0RC1 Redis Sentinel Version => 0.1 Available serializers => php, json, igbinary, msgpack -Available compression => lzf, zstd +Available compression => lzf, zstd, lz4 Directive => Local Value => Master Value redis.arrays.algorithm => no value => no value @@ -32,6 +32,7 @@ redis.clusters.timeout => 0 => 0 redis.pconnect.pooling_enabled => 1 => 1 redis.pconnect.connection_limit => 0 => 0 redis.pconnect.echo_check_liveness => 1 => 1 +redis.pconnect.pool_pattern => no value => no value redis.session.locking_enabled => 0 => 0 redis.session.lock_expire => 0 => 0 redis.session.lock_retries => 10 => 10 diff --git a/REFLECTION b/REFLECTION index 56f4cc9..0f1a2c7 100644 --- a/REFLECTION +++ b/REFLECTION @@ -1,4 +1,4 @@ -Extension [ extension #112 redis version 5.2.2 ] { +Extension [ extension #114 redis version 5.3.0RC1 ] { - Dependencies { Dependency [ igbinary (Required) ] @@ -80,6 +80,9 @@ Extension [ extension #112 redis version 5.2.2 ] { Entry [ redis.pconnect.echo_check_liveness ] Current = '1' } + Entry [ redis.pconnect.pool_pattern ] + Current = '' + } Entry [ redis.session.locking_enabled ] Current = '0' } @@ -97,7 +100,7 @@ Extension [ extension #112 redis version 5.2.2 ] { - Classes [6] { Class [ class Redis ] { - - Constants [33] { + - Constants [36] { Constant [ public int REDIS_NOT_FOUND ] { 0 } Constant [ public int REDIS_STRING ] { 1 } Constant [ public int REDIS_SET ] { 2 } @@ -126,9 +129,12 @@ Extension [ extension #112 redis version 5.2.2 ] { Constant [ public int COMPRESSION_ZSTD_MIN ] { 1 } Constant [ public int COMPRESSION_ZSTD_DEFAULT ] { 3 } Constant [ public int COMPRESSION_ZSTD_MAX ] { 22 } + Constant [ public int COMPRESSION_LZ4 ] { 3 } Constant [ public int OPT_SCAN ] { 4 } Constant [ public int SCAN_RETRY ] { 1 } Constant [ public int SCAN_NORETRY ] { 0 } + Constant [ public int SCAN_PREFIX ] { 2 } + Constant [ public int SCAN_NOPREFIX ] { 3 } Constant [ public string AFTER ] { after } Constant [ public string BEFORE ] { before } } @@ -142,7 +148,7 @@ Extension [ extension #112 redis version 5.2.2 ] { - Properties [0] { } - - Methods [234] { + - Methods [235] { Method [ public method __construct ] { - Parameters [0] { @@ -176,6 +182,14 @@ Extension [ extension #112 redis version 5.2.2 ] { } } + Method [ public method acl ] { + + - Parameters [2] { + Parameter #0 [ $subcmd ] + Parameter #1 [ ...$args ] + } + } + Method [ public method append ] { - Parameters [2] { @@ -187,7 +201,7 @@ Extension [ extension #112 redis version 5.2.2 ] { Method [ public method auth ] { - Parameters [1] { - Parameter #0 [ $password ] + Parameter #0 [ $auth ] } } @@ -2288,7 +2302,7 @@ Extension [ extension #112 redis version 5.2.2 ] { Class [ class RedisCluster ] { - - Constants [37] { + - Constants [40] { Constant [ public int REDIS_NOT_FOUND ] { 0 } Constant [ public int REDIS_STRING ] { 1 } Constant [ public int REDIS_SET ] { 2 } @@ -2316,9 +2330,12 @@ Extension [ extension #112 redis version 5.2.2 ] { Constant [ public int COMPRESSION_ZSTD_MIN ] { 1 } Constant [ public int COMPRESSION_ZSTD_DEFAULT ] { 3 } Constant [ public int COMPRESSION_ZSTD_MAX ] { 22 } + Constant [ public int COMPRESSION_LZ4 ] { 3 } Constant [ public int OPT_SCAN ] { 4 } Constant [ public int SCAN_RETRY ] { 1 } Constant [ public int SCAN_NORETRY ] { 0 } + Constant [ public int SCAN_PREFIX ] { 2 } + Constant [ public int SCAN_NOPREFIX ] { 3 } Constant [ public int OPT_SLAVE_FAILOVER ] { 5 } Constant [ public int FAILOVER_NONE ] { 0 } Constant [ public int FAILOVER_ERROR ] { 1 } @@ -2337,7 +2354,7 @@ Extension [ extension #112 redis version 5.2.2 ] { - Properties [0] { } - - Methods [185] { + - Methods [186] { Method [ public method __construct ] { - Parameters [6] { @@ -2383,6 +2400,15 @@ Extension [ extension #112 redis version 5.2.2 ] { } } + Method [ public method acl ] { + + - Parameters [3] { + Parameter #0 [ $key_or_address ] + Parameter #1 [ $subcmd ] + Parameter #2 [ ...$args ] + } + } + Method [ public method append ] { - Parameters [2] { diff --git a/php-pecl-redis5.spec b/php-pecl-redis5.spec index 848f2de..ddcbc82 100644 --- a/php-pecl-redis5.spec +++ b/php-pecl-redis5.spec @@ -19,43 +19,44 @@ %global pecl_name redis %global with_zts 0%{!?_without_zts:%{?__ztsphp:1}} -%global with_tests 0%{!?_without_tests:1} -%global with_igbin 1 +%bcond_without tests +%bcond_without igbinary # after 20-json, 40-igbinary and 40-msgpack %global ini_name 50-%{pecl_name}.ini -%global upstream_version 5.2.2 -#global upstream_prever RC2 +%global upstream_version 5.3.0 +%global upstream_prever RC1 Summary: Extension for communicating with the Redis key-value store Name: %{?sub_prefix}php-pecl-redis5 Version: %{upstream_version}%{?upstream_prever:~%{upstream_prever}} -Release: 2%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} -Source0: https://pecl.php.net/get/%{pecl_name}-%{upstream_version}%{?upstream_prever}.tgz +Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} License: PHP URL: https://pecl.php.net/package/redis +Source0: https://pecl.php.net/get/%{pecl_name}-%{upstream_version}%{?upstream_prever}.tgz -Patch0: https://patch-diff.githubusercontent.com/raw/phpredis/phpredis/pull/1750.patch +Patch0: redis-lz4.patch BuildRequires: %{?dtsprefix}gcc BuildRequires: %{?scl_prefix}php-devel > 7 BuildRequires: %{?scl_prefix}php-pear BuildRequires: %{?scl_prefix}php-json -%if %{with_igbin} +%if %{with igbinary} BuildRequires: %{?scl_prefix}php-pecl-igbinary-devel %endif BuildRequires: %{?scl_prefix}php-pecl-msgpack-devel >= 2.0.3 BuildRequires: liblzf-devel BuildRequires: libzstd-devel >= 1.3.0 +BuildRequires: lz4-devel # to run Test suite -%if %{with_tests} +%if %{with tests} BuildRequires: redis >= 3 %endif Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api} Requires: %{?scl_prefix}php(api) = %{php_core_api} Requires: %{?scl_prefix}php-json%{?_isa} -%if %{with_igbin} +%if %{with igbinary} Requires: %{?scl_prefix}php-pecl(igbinary)%{?_isa} %endif Requires: %{?scl_prefix}php-pecl-msgpack%{?_isa} @@ -188,6 +189,7 @@ extension = %{pecl_name}.so ;redis.pconnect.pooling_enabled = 1 ;redis.pconnect.connection_limit = 0 ;redis.pconnect.echo_check_liveness = 1 +;redis.pconnect.pool_pattern => '' ;redis.session.lock_expire = 0 ;redis.session.lock_retries = 10 ;redis.session.lock_wait_time = 2000 @@ -198,12 +200,11 @@ EOF %build %{?dtsenable} -cd NTS -%{_bindir}/phpize +peclconf() { %configure \ --enable-redis \ --enable-redis-session \ -%if %{with_igbin} +%if %{with igbinary} --enable-redis-igbinary \ %endif --enable-redis-msgpack \ @@ -211,24 +212,20 @@ cd NTS --with-liblzf \ --enable-redis-zstd \ --with-libzstd \ - --with-php-config=%{_bindir}/php-config + --enable-redis-lz4 \ + --with-liblz4 \ + --with-php-config=$1 +} + +cd NTS +%{_bindir}/phpize +peclconf %{_bindir}/php-config make %{?_smp_mflags} %if %{with_zts} cd ../ZTS %{_bindir}/zts-phpize -%configure \ - --enable-redis \ - --enable-redis-session \ -%if %{with_igbin} - --enable-redis-igbinary \ -%endif - --enable-redis-msgpack \ - --enable-redis-lzf \ - --with-liblzf \ - --enable-redis-zstd \ - --with-libzstd \ - --with-php-config=%{_bindir}/zts-php-config +peclconf %{_bindir}/zts-php-config make %{?_smp_mflags} %endif @@ -259,7 +256,7 @@ done %check # simple module load test DEPS="--no-php-ini --define extension=json.so" -%if %{with_igbin} +%if %{with igbinary} DEPS="$DEPS --define extension=igbinary.so" %endif DEPS="$DEPS --define extension=msgpack.so" @@ -274,7 +271,7 @@ DEPS="$DEPS --define extension=msgpack.so" --modules | grep %{pecl_name} %endif -%if %{with_tests} +%if %{with tests} cd NTS/tests : Launch redis server @@ -346,11 +343,19 @@ fi %changelog +* Fri Jun 26 2020 Remi Collet - 5.3.0~RC1-1 +- update to 5.3.0RC1 +- enable lz4 compression support +- drop patch merged upstream +- add upstream patch to fix lz4 library name +- add new option in provided configuration file + * Wed May 6 2020 Remi Collet - 5.2.2-2 - test build for https://github.com/phpredis/phpredis/pull/1750 * Wed May 6 2020 Remi Collet - 5.2.2-1 - update to 5.2.2 +- refresh options in provided configuration file * Fri Mar 20 2020 Remi Collet - 5.2.1-1 - update to 5.2.1 diff --git a/redis-lz4.patch b/redis-lz4.patch new file mode 100644 index 0000000..6357c09 --- /dev/null +++ b/redis-lz4.patch @@ -0,0 +1,69 @@ +From 19269cb1db073376364d2655fc828daeb8f1006e Mon Sep 17 00:00:00 2001 +From: Remi Collet +Date: Fri, 26 Jun 2020 07:18:57 +0200 +Subject: [PATCH 1/2] fix lz4 library name + +--- + config.m4 | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/config.m4 b/config.m4 +index 3044930..2105801 100644 +--- a/config.m4 ++++ b/config.m4 +@@ -201,7 +201,8 @@ if test "$PHP_REDIS" != "no"; then + fi + + if test "$PHP_REDIS_LZ4" != "no"; then +- AC_DEFINE(HAVE_REDIS_LZ4, 1, [ ]) ++ AC_DEFINE(HAVE_REDIS_LZ4, 1, [ ]) ++ if test "$PHP_LIBZSTD" != "no"; then + AC_MSG_CHECKING(for liblz4 files in default path) + for i in $PHP_LIBLZ4 /usr/local /usr; do + if test -r $i/include/lz4.h; then +@@ -216,13 +217,16 @@ if test "$PHP_REDIS" != "no"; then + fi + PHP_CHECK_LIBRARY(lz4, LZ4_compress, + [ +- PHP_ADD_LIBRARY_WITH_PATH(zstd, $LIBLZ4_DIR/$PHP_LIBDIR, REDIS_SHARED_LIBADD) ++ PHP_ADD_LIBRARY_WITH_PATH(lz4, $LIBLZ4_DIR/$PHP_LIBDIR, REDIS_SHARED_LIBADD) + ], [ + AC_MSG_ERROR([could not find usable liblz4]) + ], [ + -L$LIBLZ4_DIR/$PHP_LIBDIR + ]) + PHP_SUBST(REDIS_SHARED_LIBADD) ++ else ++ AC_MSG_ERROR([only system libz4 is supported]) ++ fi + fi + + if test "$PHP_REDIS_ZSTD" != "no"; then +-- +2.25.4 + +From e5de8fa1ffa4824944283d78e9475df527567a49 Mon Sep 17 00:00:00 2001 +From: Remi Collet +Date: Fri, 26 Jun 2020 07:21:21 +0200 +Subject: [PATCH 2/2] copy/paste err + +--- + config.m4 | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/config.m4 b/config.m4 +index 2105801..4445400 100644 +--- a/config.m4 ++++ b/config.m4 +@@ -202,7 +202,7 @@ if test "$PHP_REDIS" != "no"; then + + if test "$PHP_REDIS_LZ4" != "no"; then + AC_DEFINE(HAVE_REDIS_LZ4, 1, [ ]) +- if test "$PHP_LIBZSTD" != "no"; then ++ if test "$PHP_LIBLZ4" != "no"; then + AC_MSG_CHECKING(for liblz4 files in default path) + for i in $PHP_LIBLZ4 /usr/local /usr; do + if test -r $i/include/lz4.h; then +-- +2.25.4 + -- cgit