From 096ed5ea2e6309ce2f484ece0db964c5cc740b64 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Mon, 17 Feb 2020 08:55:10 +0100 Subject: update to 5.2.0RC1 --- PHPINFO | 11 ++- REFLECTION | 252 ++++++++++++++++++++++++++++++++++---------------- RedisSentinelTest.php | 113 ++++++++++++++++++++++ php-pecl-redis5.spec | 31 +++---- 4 files changed, 307 insertions(+), 100 deletions(-) create mode 100644 RedisSentinelTest.php diff --git a/PHPINFO b/PHPINFO index 5d8b714..0ff7fe8 100644 --- a/PHPINFO +++ b/PHPINFO @@ -2,7 +2,8 @@ redis Redis Support => enabled -Redis Version => 5.1.1 +Redis Version => 5.2.0RC1 +Redis Sentinel Version => 0.1RC1 Available serializers => php, json, igbinary, msgpack Available compression => lzf, zstd @@ -11,7 +12,6 @@ redis.arrays.algorithm => no value => no value redis.arrays.auth => no value => no value redis.arrays.autorehash => 0 => 0 redis.arrays.connecttimeout => 0 => 0 -redis.arrays.consistent => 0 => 0 redis.arrays.distributor => no value => no value redis.arrays.functions => no value => no value redis.arrays.hosts => no value => no value @@ -22,15 +22,16 @@ redis.arrays.pconnect => 0 => 0 redis.arrays.previous => no value => no value redis.arrays.readtimeout => 0 => 0 redis.arrays.retryinterval => 0 => 0 -redis.clusters.auth => no value => no value +redis.arrays.consistent => 0 => 0 redis.clusters.cache_slots => 0 => 0 +redis.clusters.auth => no value => no value redis.clusters.persistent => 0 => 0 redis.clusters.read_timeout => 0 => 0 redis.clusters.seeds => no value => no value redis.clusters.timeout => 0 => 0 -redis.pconnect.connection_limit => 0 => 0 redis.pconnect.pooling_enabled => 1 => 1 +redis.pconnect.connection_limit => 0 => 0 +redis.session.locking_enabled => 0 => 0 redis.session.lock_expire => 0 => 0 redis.session.lock_retries => 10 => 10 redis.session.lock_wait_time => 2000 => 2000 -redis.session.locking_enabled => 0 => 0 diff --git a/REFLECTION b/REFLECTION index defb242..e9ab96c 100644 --- a/REFLECTION +++ b/REFLECTION @@ -1,4 +1,4 @@ -Extension [ extension #197 redis version 5.1.1 ] { +Extension [ extension #109 redis version 5.2.0RC1 ] { - Dependencies { Dependency [ igbinary (Required) ] @@ -20,9 +20,6 @@ Extension [ extension #197 redis version 5.1.1 ] { Entry [ redis.arrays.connecttimeout ] Current = '0' } - Entry [ redis.arrays.consistent ] - Current = '0' - } Entry [ redis.arrays.distributor ] Current = '' } @@ -53,12 +50,15 @@ Extension [ extension #197 redis version 5.1.1 ] { Entry [ redis.arrays.retryinterval ] Current = '0' } - Entry [ redis.clusters.auth ] - Current = '' + Entry [ redis.arrays.consistent ] + Current = '0' } Entry [ redis.clusters.cache_slots ] Current = '0' } + Entry [ redis.clusters.auth ] + Current = '' + } Entry [ redis.clusters.persistent ] Current = '0' } @@ -71,11 +71,14 @@ Extension [ extension #197 redis version 5.1.1 ] { Entry [ redis.clusters.timeout ] Current = '0' } + Entry [ redis.pconnect.pooling_enabled ] + Current = '1' + } Entry [ redis.pconnect.connection_limit ] Current = '0' } - Entry [ redis.pconnect.pooling_enabled ] - Current = '1' + Entry [ redis.session.locking_enabled ] + Current = '0' } Entry [ redis.session.lock_expire ] Current = '0' @@ -86,46 +89,43 @@ Extension [ extension #197 redis version 5.1.1 ] { Entry [ redis.session.lock_wait_time ] Current = '2000' } - Entry [ redis.session.locking_enabled ] - Current = '0' - } } - - Classes [5] { + - Classes [6] { Class [ class Redis ] { - Constants [33] { - Constant [ public integer REDIS_NOT_FOUND ] { 0 } - Constant [ public integer REDIS_STRING ] { 1 } - Constant [ public integer REDIS_SET ] { 2 } - Constant [ public integer REDIS_LIST ] { 3 } - Constant [ public integer REDIS_ZSET ] { 4 } - Constant [ public integer REDIS_HASH ] { 5 } - Constant [ public integer REDIS_STREAM ] { 6 } - Constant [ public integer PIPELINE ] { 2 } - Constant [ public integer ATOMIC ] { 0 } - Constant [ public integer MULTI ] { 1 } - Constant [ public integer OPT_SERIALIZER ] { 1 } - Constant [ public integer OPT_PREFIX ] { 2 } - Constant [ public integer OPT_READ_TIMEOUT ] { 3 } - Constant [ public integer OPT_TCP_KEEPALIVE ] { 6 } - Constant [ public integer OPT_COMPRESSION ] { 7 } - Constant [ public integer OPT_REPLY_LITERAL ] { 8 } - Constant [ public integer OPT_COMPRESSION_LEVEL ] { 9 } - Constant [ public integer SERIALIZER_NONE ] { 0 } - Constant [ public integer SERIALIZER_PHP ] { 1 } - Constant [ public integer SERIALIZER_IGBINARY ] { 2 } - Constant [ public integer SERIALIZER_MSGPACK ] { 3 } - Constant [ public integer SERIALIZER_JSON ] { 4 } - Constant [ public integer COMPRESSION_NONE ] { 0 } - Constant [ public integer COMPRESSION_LZF ] { 1 } - Constant [ public integer COMPRESSION_ZSTD ] { 2 } - Constant [ public integer COMPRESSION_ZSTD_MIN ] { 1 } - Constant [ public integer COMPRESSION_ZSTD_DEFAULT ] { 3 } - Constant [ public integer COMPRESSION_ZSTD_MAX ] { 22 } - Constant [ public integer OPT_SCAN ] { 4 } - Constant [ public integer SCAN_RETRY ] { 1 } - Constant [ public integer SCAN_NORETRY ] { 0 } + Constant [ public int REDIS_NOT_FOUND ] { 0 } + Constant [ public int REDIS_STRING ] { 1 } + Constant [ public int REDIS_SET ] { 2 } + Constant [ public int REDIS_LIST ] { 3 } + Constant [ public int REDIS_ZSET ] { 4 } + Constant [ public int REDIS_HASH ] { 5 } + Constant [ public int REDIS_STREAM ] { 6 } + Constant [ public int PIPELINE ] { 2 } + Constant [ public int ATOMIC ] { 0 } + Constant [ public int MULTI ] { 1 } + Constant [ public int OPT_SERIALIZER ] { 1 } + Constant [ public int OPT_PREFIX ] { 2 } + Constant [ public int OPT_READ_TIMEOUT ] { 3 } + Constant [ public int OPT_TCP_KEEPALIVE ] { 6 } + Constant [ public int OPT_COMPRESSION ] { 7 } + Constant [ public int OPT_REPLY_LITERAL ] { 8 } + Constant [ public int OPT_COMPRESSION_LEVEL ] { 9 } + Constant [ public int SERIALIZER_NONE ] { 0 } + Constant [ public int SERIALIZER_PHP ] { 1 } + Constant [ public int SERIALIZER_IGBINARY ] { 2 } + Constant [ public int SERIALIZER_MSGPACK ] { 3 } + Constant [ public int SERIALIZER_JSON ] { 4 } + Constant [ public int COMPRESSION_NONE ] { 0 } + Constant [ public int COMPRESSION_LZF ] { 1 } + Constant [ public int COMPRESSION_ZSTD ] { 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 OPT_SCAN ] { 4 } + Constant [ public int SCAN_RETRY ] { 1 } + Constant [ public int SCAN_NORETRY ] { 0 } Constant [ public string AFTER ] { after } Constant [ public string BEFORE ] { before } } @@ -2285,41 +2285,41 @@ Extension [ extension #197 redis version 5.1.1 ] { Class [ class RedisCluster ] { - Constants [37] { - Constant [ public integer REDIS_NOT_FOUND ] { 0 } - Constant [ public integer REDIS_STRING ] { 1 } - Constant [ public integer REDIS_SET ] { 2 } - Constant [ public integer REDIS_LIST ] { 3 } - Constant [ public integer REDIS_ZSET ] { 4 } - Constant [ public integer REDIS_HASH ] { 5 } - Constant [ public integer REDIS_STREAM ] { 6 } - Constant [ public integer ATOMIC ] { 0 } - Constant [ public integer MULTI ] { 1 } - Constant [ public integer OPT_SERIALIZER ] { 1 } - Constant [ public integer OPT_PREFIX ] { 2 } - Constant [ public integer OPT_READ_TIMEOUT ] { 3 } - Constant [ public integer OPT_TCP_KEEPALIVE ] { 6 } - Constant [ public integer OPT_COMPRESSION ] { 7 } - Constant [ public integer OPT_REPLY_LITERAL ] { 8 } - Constant [ public integer OPT_COMPRESSION_LEVEL ] { 9 } - Constant [ public integer SERIALIZER_NONE ] { 0 } - Constant [ public integer SERIALIZER_PHP ] { 1 } - Constant [ public integer SERIALIZER_IGBINARY ] { 2 } - Constant [ public integer SERIALIZER_MSGPACK ] { 3 } - Constant [ public integer SERIALIZER_JSON ] { 4 } - Constant [ public integer COMPRESSION_NONE ] { 0 } - Constant [ public integer COMPRESSION_LZF ] { 1 } - Constant [ public integer COMPRESSION_ZSTD ] { 2 } - Constant [ public integer COMPRESSION_ZSTD_MIN ] { 1 } - Constant [ public integer COMPRESSION_ZSTD_DEFAULT ] { 3 } - Constant [ public integer COMPRESSION_ZSTD_MAX ] { 22 } - Constant [ public integer OPT_SCAN ] { 4 } - Constant [ public integer SCAN_RETRY ] { 1 } - Constant [ public integer SCAN_NORETRY ] { 0 } - Constant [ public integer OPT_SLAVE_FAILOVER ] { 5 } - Constant [ public integer FAILOVER_NONE ] { 0 } - Constant [ public integer FAILOVER_ERROR ] { 1 } - Constant [ public integer FAILOVER_DISTRIBUTE ] { 2 } - Constant [ public integer FAILOVER_DISTRIBUTE_SLAVES ] { 3 } + Constant [ public int REDIS_NOT_FOUND ] { 0 } + Constant [ public int REDIS_STRING ] { 1 } + Constant [ public int REDIS_SET ] { 2 } + Constant [ public int REDIS_LIST ] { 3 } + Constant [ public int REDIS_ZSET ] { 4 } + Constant [ public int REDIS_HASH ] { 5 } + Constant [ public int REDIS_STREAM ] { 6 } + Constant [ public int ATOMIC ] { 0 } + Constant [ public int MULTI ] { 1 } + Constant [ public int OPT_SERIALIZER ] { 1 } + Constant [ public int OPT_PREFIX ] { 2 } + Constant [ public int OPT_READ_TIMEOUT ] { 3 } + Constant [ public int OPT_TCP_KEEPALIVE ] { 6 } + Constant [ public int OPT_COMPRESSION ] { 7 } + Constant [ public int OPT_REPLY_LITERAL ] { 8 } + Constant [ public int OPT_COMPRESSION_LEVEL ] { 9 } + Constant [ public int SERIALIZER_NONE ] { 0 } + Constant [ public int SERIALIZER_PHP ] { 1 } + Constant [ public int SERIALIZER_IGBINARY ] { 2 } + Constant [ public int SERIALIZER_MSGPACK ] { 3 } + Constant [ public int SERIALIZER_JSON ] { 4 } + Constant [ public int COMPRESSION_NONE ] { 0 } + Constant [ public int COMPRESSION_LZF ] { 1 } + Constant [ public int COMPRESSION_ZSTD ] { 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 OPT_SCAN ] { 4 } + Constant [ public int SCAN_RETRY ] { 1 } + Constant [ public int SCAN_NORETRY ] { 0 } + Constant [ public int OPT_SLAVE_FAILOVER ] { 5 } + Constant [ public int FAILOVER_NONE ] { 0 } + Constant [ public int FAILOVER_ERROR ] { 1 } + Constant [ public int FAILOVER_DISTRIBUTE ] { 2 } + Constant [ public int FAILOVER_DISTRIBUTE_SLAVES ] { 3 } Constant [ public string AFTER ] { after } Constant [ public string BEFORE ] { before } } @@ -3871,6 +3871,102 @@ Extension [ extension #197 redis version 5.1.1 ] { } } + Class [ class RedisSentinel ] { + + - Constants [0] { + } + + - Static properties [0] { + } + + - Static methods [0] { + } + + - Properties [0] { + } + + - Methods [11] { + Method [ public method __construct ] { + + - Parameters [6] { + Parameter #0 [ $host ] + Parameter #1 [ $port ] + Parameter #2 [ $timeout ] + Parameter #3 [ $persistent ] + Parameter #4 [ $retry_interval ] + Parameter #5 [ $read_timeout ] + } + } + + Method [ public method ckquorum ] { + + - Parameters [1] { + Parameter #0 [ $value ] + } + } + + Method [ public method failover ] { + + - Parameters [1] { + Parameter #0 [ $value ] + } + } + + Method [ public method flushconfig ] { + + - Parameters [0] { + } + } + + Method [ public method getMasterAddrByName ] { + + - Parameters [1] { + Parameter #0 [ $value ] + } + } + + Method [ public method master ] { + + - Parameters [1] { + Parameter #0 [ $value ] + } + } + + Method [ public method masters ] { + + - Parameters [0] { + } + } + + Method [ public method ping ] { + + - Parameters [0] { + } + } + + Method [ public method reset ] { + + - Parameters [1] { + Parameter #0 [ $value ] + } + } + + Method [ public method sentinels ] { + + - Parameters [1] { + Parameter #0 [ $value ] + } + } + + Method [ public method slaves ] { + + - Parameters [1] { + Parameter #0 [ $value ] + } + } + } + } + Class [ class RedisException extends Exception implements Throwable ] { - Constants [0] { diff --git a/RedisSentinelTest.php b/RedisSentinelTest.php new file mode 100644 index 0000000..b88e006 --- /dev/null +++ b/RedisSentinelTest.php @@ -0,0 +1,113 @@ +getHost()); + } + + public function setUp() + { + $this->sentinel = $this->newInstance(); + } + + public function testCkquorum() + { + $this->assertTrue($this->sentinel->ckquorum(self::NAME)); + } + + public function testFailover() + { + $this->assertFalse($this->sentinel->failover(self::NAME)); + } + + public function testFlushconfig() + { + $this->assertTrue($this->sentinel->flushconfig()); + } + + public function testGetMasterAddrByName() + { + $result = $this->sentinel->getMasterAddrByName(self::NAME); + $this->assertTrue(is_array($result)); + $this->assertEquals(2, count($result)); + } + + protected function checkFields(array $fields) + { + foreach ($this->fields as $k) { + $this->assertTrue(array_key_exists($k, $fields)); + } + } + + public function testMaster() + { + $result = $this->sentinel->master(self::NAME); + $this->assertTrue(is_array($result)); + $this->checkFields($result); + } + + public function testMasters() + { + $result = $this->sentinel->masters(); + $this->assertTrue(is_array($result)); + foreach ($result as $master) { + $this->checkFields($master); + } + } + + public function testPing() + { + $this->assertTrue($this->sentinel->ping()); + } + + public function testReset() + { + $this->assertFalse($this->sentinel->reset('*')); + } + + public function testSentinels() + { + $result = $this->sentinel->sentinels(self::NAME); + $this->assertTrue(is_array($result)); + foreach ($result as $sentinel) { + $this->checkFields($sentinel); + } + } + + public function testSlaves() + { + $result = $this->sentinel->slaves(self::NAME); + $this->assertTrue(is_array($result)); + foreach ($result as $slave) { + $this->checkFields($slave); + } + } +} diff --git a/php-pecl-redis5.spec b/php-pecl-redis5.spec index 79df468..c1b1875 100644 --- a/php-pecl-redis5.spec +++ b/php-pecl-redis5.spec @@ -1,6 +1,6 @@ # remirepo spec file for php-pecl-redis5 # -# Copyright (c) 2012-2019 Remi Collet +# Copyright (c) 2012-2020 Remi Collet # License: CC-BY-SA # http://creativecommons.org/licenses/by-sa/4.0/ # @@ -24,16 +24,18 @@ # after 20-json, 40-igbinary and 40-msgpack %global ini_name 50-%{pecl_name}.ini -%global upstream_version 5.1.1 -#global upstream_prever RC2 +%global upstream_version 5.2.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: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} -Source0: http://pecl.php.net/get/%{pecl_name}-%{upstream_version}%{?upstream_prever}.tgz +Source0: https://pecl.php.net/get/%{pecl_name}-%{upstream_version}%{?upstream_prever}.tgz License: PHP -URL: http://pecl.php.net/package/redis +URL: https://pecl.php.net/package/redis + +Source1: https://raw.githubusercontent.com/phpredis/phpredis/c58fb7316a82a6c5fceaaba83f3598f4212f8582/tests/RedisSentinelTest.php BuildRequires: %{?dtsprefix}gcc BuildRequires: %{?scl_prefix}php-devel > 7 @@ -42,9 +44,7 @@ BuildRequires: %{?scl_prefix}php-json %if %{with_igbin} BuildRequires: %{?scl_prefix}php-pecl-igbinary-devel %endif -%ifnarch ppc64 BuildRequires: %{?scl_prefix}php-pecl-msgpack-devel >= 2.0.3 -%endif BuildRequires: liblzf-devel BuildRequires: libzstd-devel >= 1.3.0 # to run Test suite @@ -58,9 +58,7 @@ Requires: %{?scl_prefix}php-json%{?_isa} %if %{with_igbin} Requires: %{?scl_prefix}php-pecl(igbinary)%{?_isa} %endif -%ifnarch ppc64 Requires: %{?scl_prefix}php-pecl-msgpack%{?_isa} -%endif %{?_sclreq:Requires: %{?scl_prefix}runtime%{?_sclreq}%{?_isa}} Obsoletes: %{?scl_prefix}php-%{pecl_name} < 3 @@ -132,6 +130,8 @@ sed -e 's/role="test"/role="src"/' \ -i package.xml cd NTS +cp %{SOURCE1} tests/ + # Use system library rm -r liblzf @@ -205,9 +205,7 @@ cd NTS %if %{with_igbin} --enable-redis-igbinary \ %endif -%ifnarch ppc64 --enable-redis-msgpack \ -%endif --enable-redis-lzf \ --with-liblzf \ --enable-redis-zstd \ @@ -224,9 +222,7 @@ cd ../ZTS %if %{with_igbin} --enable-redis-igbinary \ %endif -%ifnarch ppc64 --enable-redis-msgpack \ -%endif --enable-redis-lzf \ --with-liblzf \ --enable-redis-zstd \ @@ -263,11 +259,9 @@ done # simple module load test DEPS="--no-php-ini --define extension=json.so" %if %{with_igbin} - DEPS="$DEPS --define extension=igbinary.so" -%endif -%ifnarch ppc64 - DEPS="$DEPS --define extension=msgpack.so" +DEPS="$DEPS --define extension=igbinary.so" %endif +DEPS="$DEPS --define extension=msgpack.so" %{__php} $DEPS \ --define extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \ @@ -351,6 +345,9 @@ fi %changelog +* Mon Feb 17 2020 Remi Collet - 5.2.0~RC1-1 +- update to 5.2.0RC1 + * Mon Nov 11 2019 Remi Collet - 5.1.1-1 - update to 5.1.1 -- cgit