From 489347d97db58d442e822d7c4839c2d31f307378 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Fri, 21 Dec 2018 13:43:30 +0100 Subject: v3.1.0 --- 330.patch | 230 ------------------------- 8bfdbcc9063dafcb25fdb1d1705e07ee027d7379.patch | 65 ------- PHPINFO | 25 +-- REFLECTION | 37 ++-- php-pecl-memcached.spec | 13 +- 5 files changed, 42 insertions(+), 328 deletions(-) delete mode 100644 330.patch delete mode 100644 8bfdbcc9063dafcb25fdb1d1705e07ee027d7379.patch diff --git a/330.patch b/330.patch deleted file mode 100644 index aa6739f..0000000 --- a/330.patch +++ /dev/null @@ -1,230 +0,0 @@ -From d81697f7a04646edbbed8ecf34cb524ab1ff8d3c Mon Sep 17 00:00:00 2001 -From: Remi Collet -Date: Mon, 20 Feb 2017 19:27:39 +0100 -Subject: [PATCH 1/2] Refresh memcached.ini provided configuration - -- remove deprecated options -- add missing memcached.sess_server_failure_limit option -- comment all options default value (only needed when not default value) - see php.ini-production which follow this convention ---- - memcached.ini | 56 +++++++++++++++++++++++++++----------------------------- - 1 file changed, 27 insertions(+), 29 deletions(-) - -diff --git a/memcached.ini b/memcached.ini -index 59001aa..fa9a6fd 100644 ---- a/memcached.ini -+++ b/memcached.ini -@@ -2,45 +2,39 @@ - ; Use session locking - ; valid values: On, Off - ; the default is On --memcached.sess_locking = On -- --; !! DEPRECATED AND REMOVED in 3.x !! --; memcached.sess_lock_wait = 150000 -- --; !! DEPRECATED AND REMOVED in 3.x !! --; memcached.sess_lock_max_wait = 0; -+;memcached.sess_locking = On - - ; The minimum time, in milliseconds, to wait between session lock attempts. - ; This value is double on each lock retry until memcached.sess_lock_wait_max - ; is reached, after which any further retries will take sess_lock_wait_max seconds. - ; Default is 1000. --memcached.sess_lock_wait_min = 1000; -+;memcached.sess_lock_wait_min = 1000; - - ; The maximum time, in milliseconds, to wait between session lock attempts. - ; Default is 2000. --memcached.sess_lock_wait_max = 2000; -+;memcached.sess_lock_wait_max = 2000; - - ; The number of times to retry locking the session lock, not including the first attempt. - ; Default is 5. --memcached.sess_lock_retries = 5; -+;memcached.sess_lock_retries = 5; - - ; The time, in seconds, before a lock should release itself. - ; Setting to 0 results in the default behaviour, which is to - ; use the memcached.sess_lock_max_wait setting. If that is - ; also 0, max_execution_time will be used. --memcached.sess_lock_expire = 0; -+;memcached.sess_lock_expire = 0; - - ; memcached session key prefix - ; valid values are strings less than 219 bytes long - ; the default value is "memc.sess.key." --memcached.sess_prefix = "memc.sess.key." -+;memcached.sess_prefix = "memc.sess.key." - - ; Whether or not to re-use the memcached connections corresponding to the value(s) - ; of session.save_path after the execution of the script ends. - ; Don't use this if certain settings (e.g. SASL settings, sess_binary_protocol) would - ; be overridden between requests. - ; Default is Off. --memcached.sess_persistent = Off -+;memcached.sess_persistent = Off - - ; memcached session consistent hash mode - ; if set to On, consistent hashing (libketama) is used -@@ -48,11 +42,15 @@ memcached.sess_persistent = Off - ; When consistent hashing is used, one can add or remove cache - ; node(s) without messing up too much with existing keys - ; default is On --memcached.sess_consistent_hash = On -+;memcached.sess_consistent_hash = On - - ; Allow failed memcached server to automatically be removed. - ; Default is Off. (In previous versions, this setting was called memcached.sess_remove_failed) --memcached.sess_remove_failed_servers = Off -+;memcached.sess_remove_failed_servers = Off -+ -+; Set this value to enable the server be removed after -+; configured number of continuous times connection failure. -+;memcached.sess_server_failure_limit = 0 - - ; Write data to a number of additional memcached servers - ; This is "poor man's HA" as libmemcached calls it. -@@ -61,34 +59,34 @@ memcached.sess_remove_failed_servers = Off - ; from a replica. However, if the failed memcache server - ; becomes available again it will read the session from there - ; which could have old data or no data at all --memcached.sess_number_of_replicas = 0 -+;memcached.sess_number_of_replicas = 0 - - ; Use the memcached binary protocol for memcached sessions (Instead of the text protocol) - ; libmemcached replicas work only if binary mode is enabled. - ; However, certain proxies (such as twemproxy) will work only if the binary protocol is disabled. - ; Default is On. In older versions of php-memcached, this setting was Off and was called memcached.sess_binary. --memcached.sess_binary_protocol = On -+;memcached.sess_binary_protocol = On - - ; memcached session replica read randomize --memcached.sess_randomize_replica_read = Off -+;memcached.sess_randomize_replica_read = Off - - ; memcached connect timeout value - ; In non-blocking mode this changes the value of the timeout - ; during socket connection in milliseconds. Specifying -1 means an infinite timeout. --memcached.sess_connect_timeout = 1000 -+;memcached.sess_connect_timeout = 1000 - - ; Session SASL username - ; Both username and password need to be set for SASL to be enabled - ; In addition to this memcached.use_sasl needs to be on --memcached.sess_sasl_username = NULL -+;memcached.sess_sasl_username = NULL - - ; Session SASL password --memcached.sess_sasl_password = NULL -+;memcached.sess_sasl_password = NULL - - ; Set the compression type - ; valid values are: fastlz, zlib - ; the default is fastlz --memcached.compression_type = "fastlz" -+;memcached.compression_type = "fastlz" - - ; Compression factor - ; Store compressed value only if the compression -@@ -98,13 +96,13 @@ memcached.compression_type = "fastlz" - ; plain_len > comp_len * factor - ; - ; the default value is 1.3 (23% space saving) --memcached.compression_factor = "1.3" -+;memcached.compression_factor = "1.3" - - ; The compression threshold - ; - ; Do not compress serialized values below this threshold. - ; the default is 2000 bytes --memcached.compression_threshold = 2000 -+;memcached.compression_threshold = 2000 - - ; Set the default serializer for new memcached objects. - ; valid values are: php, igbinary, json, json_array, msgpack -@@ -119,14 +117,14 @@ memcached.compression_threshold = 2000 - ; msgpack - a cross-language binary serializer - ; - ; The default is igbinary if available, then msgpack if available, then php otherwise. --memcached.serializer = "igbinary" -+;memcached.serializer = "igbinary" - - ; The amount of retries for failed store commands. - ; This mechanism allows transparent fail-over to secondary servers when - ; set/increment/decrement/setMulti operations fail on the desired server in a multi-server - ; environment. - ; the default is 2 --memcached.store_retry_count = 2 -+;memcached.store_retry_count = 2 - - ; Sets the default for consistent hashing for new connections. - ; (To configure consistent hashing for session connections, -@@ -137,7 +135,7 @@ memcached.store_retry_count = 2 - ; When consistent hashing is used, one can add or remove cache - ; node(s) without messing up too much with existing keys - ; default is Off --memcached.default_consistent_hash = Off -+;memcached.default_consistent_hash = Off - - ; Sets the default memcached protocol for new connections. - ; (To configure the memcached protocol for connections used by sessions, -@@ -146,7 +144,7 @@ memcached.default_consistent_hash = Off - ; If set to On, the memcached binary protocol is used by default. - ; If set to Off, the memcached text protocol is used. - ; Default is Off --memcached.default_binary_protocol = Off -+;memcached.default_binary_protocol = Off - - ; Sets the default memcached connection timeout for new connections. - ; (To configure the memcached connection timeout for sessions, -@@ -155,4 +153,4 @@ memcached.default_binary_protocol = Off - ; during socket connection in milliseconds. Specifying -1 means an infinite timeout. - ; Specifying 0 means using the memcached library's default connection timeout. - ; Default is 0. --memcached.default_connect_timeout = 0 -+;memcached.default_connect_timeout = 0 - -From 0a90491dd13af8dfc9a2e1ee600590fe9245ac50 Mon Sep 17 00:00:00 2001 -From: Remi Collet -Date: Mon, 20 Feb 2017 19:32:37 +0100 -Subject: [PATCH 2/2] set sess_binary_protocol off by default with older - libmemcached - ---- - memcached.ini | 4 +++- - php_memcached.c | 4 ++++ - 2 files changed, 7 insertions(+), 1 deletion(-) - -diff --git a/memcached.ini b/memcached.ini -index fa9a6fd..6d05da3 100644 ---- a/memcached.ini -+++ b/memcached.ini -@@ -64,7 +64,9 @@ - ; Use the memcached binary protocol for memcached sessions (Instead of the text protocol) - ; libmemcached replicas work only if binary mode is enabled. - ; However, certain proxies (such as twemproxy) will work only if the binary protocol is disabled. --; Default is On. In older versions of php-memcached, this setting was Off and was called memcached.sess_binary. -+; In older versions of php-memcached, this setting was Off and was called memcached.sess_binary. -+; Default is On with libmemcached 1.0.18 or newer. -+; Default is Off with older version. - ;memcached.sess_binary_protocol = On - - ; memcached session replica read randomize -diff --git a/php_memcached.c b/php_memcached.c -index 1967332..b920970 100644 ---- a/php_memcached.c -+++ b/php_memcached.c -@@ -332,7 +332,11 @@ PHP_INI_BEGIN() - MEMC_SESSION_INI_ENTRY("lock_wait_max", "2000", OnUpdateLongGEZero, lock_wait_max) - MEMC_SESSION_INI_ENTRY("lock_retries", "5", OnUpdateLong, lock_retries) - MEMC_SESSION_INI_ENTRY("lock_expire", "0", OnUpdateLongGEZero, lock_expiration) -+#if defined(LIBMEMCACHED_VERSION_HEX) && LIBMEMCACHED_VERSION_HEX < 0x01000018 -+ MEMC_SESSION_INI_ENTRY("binary_protocol", "0", OnUpdateBool, binary_protocol_enabled) -+#else - MEMC_SESSION_INI_ENTRY("binary_protocol", "1", OnUpdateBool, binary_protocol_enabled) -+#endif - MEMC_SESSION_INI_ENTRY("consistent_hash", "1", OnUpdateBool, consistent_hash_enabled) - MEMC_SESSION_INI_ENTRY("number_of_replicas", "0", OnUpdateLongGEZero, number_of_replicas) - MEMC_SESSION_INI_ENTRY("randomize_replica_read", "0", OnUpdateLongGEZero, randomize_replica_read_enabled) diff --git a/8bfdbcc9063dafcb25fdb1d1705e07ee027d7379.patch b/8bfdbcc9063dafcb25fdb1d1705e07ee027d7379.patch deleted file mode 100644 index bde5acc..0000000 --- a/8bfdbcc9063dafcb25fdb1d1705e07ee027d7379.patch +++ /dev/null @@ -1,65 +0,0 @@ -From 8bfdbcc9063dafcb25fdb1d1705e07ee027d7379 Mon Sep 17 00:00:00 2001 -From: Aaron Stone -Date: Thu, 29 Mar 2018 23:26:46 -0700 -Subject: [PATCH] Update for new PHP 7.3 REFCOUNT macros (#390) - ---- - .travis.yml | 3 +++ - php_memcached.c | 4 ++-- - php_memcached_private.h | 7 +++++++ - php_memcached_session.c | 2 +- - 4 files changed, 13 insertions(+), 3 deletions(-) - -diff --git a/php_memcached.c b/php_memcached.c -index a42ff19..bd0f559 100644 ---- a/php_memcached.c -+++ b/php_memcached.c -@@ -1298,7 +1298,7 @@ static PHP_METHOD(Memcached, __construct) - le.type = php_memc_list_entry(); - le.ptr = intern->memc; - -- GC_REFCOUNT(&le) = 1; -+ GC_SET_REFCOUNT(&le, 1); - - /* plist_key is not a persistent allocated key, thus we use str_update here */ - if (zend_hash_str_update_mem(&EG(persistent_list), ZSTR_VAL(plist_key), ZSTR_LEN(plist_key), &le, sizeof(le)) == NULL) { -@@ -3831,7 +3831,7 @@ PHP_METHOD(MemcachedServer, on) - - Z_TRY_ADDREF(fci.function_name); - if (fci.object) { -- GC_REFCOUNT(fci.object)++; -+ GC_ADDREF(fci.object); - } - } - RETURN_BOOL(rc); -diff --git a/php_memcached_private.h b/php_memcached_private.h -index a04e19b..abc0459 100644 ---- a/php_memcached_private.h -+++ b/php_memcached_private.h -@@ -72,6 +72,13 @@ typedef unsigned long int uint32_t; - # endif - #endif - -+/* Backwards compatibility for GC API change in PHP 7.3 */ -+#if PHP_VERSION_ID < 70300 -+# define GC_ADDREF(p) ++GC_REFCOUNT(p) -+# define GC_DELREF(p) --GC_REFCOUNT(p) -+# define GC_SET_REFCOUNT(p, rc) GC_REFCOUNT(p) = rc -+#endif -+ - /**************************************** - Structures and definitions - ****************************************/ -diff --git a/php_memcached_session.c b/php_memcached_session.c -index d8e9be6..607a02c 100644 ---- a/php_memcached_session.c -+++ b/php_memcached_session.c -@@ -376,7 +376,7 @@ PS_OPEN_FUNC(memcached) - le.type = s_memc_sess_list_entry(); - le.ptr = memc; - -- GC_REFCOUNT(&le) = 1; -+ GC_SET_REFCOUNT(&le, 1); - - /* plist_key is not a persistent allocated key, thus we use str_update here */ - if (zend_hash_str_update_mem(&EG(persistent_list), plist_key, plist_key_len, &le, sizeof(le)) == NULL) { diff --git a/PHPINFO b/PHPINFO index 3d571b1..c5a5319 100644 --- a/PHPINFO +++ b/PHPINFO @@ -2,7 +2,7 @@ memcached memcached support => enabled -Version => 3.0.4 +Version => 3.1.0 libmemcached version => 1.0.18 SASL support => yes Session support => yes @@ -11,22 +11,23 @@ json support => yes msgpack support => yes Directive => Local Value => Master Value -memcached.sess_locking => 1 => 1 -memcached.sess_lock_wait_min => 1000 => 1000 -memcached.sess_lock_wait_max => 2000 => 2000 +memcached.sess_locking => On => On +memcached.sess_lock_wait_min => 150 => 150 +memcached.sess_lock_wait_max => 150 => 150 memcached.sess_lock_retries => 5 => 5 memcached.sess_lock_expire => 0 => 0 -memcached.sess_binary_protocol => 1 => 1 -memcached.sess_consistent_hash => 1 => 1 +memcached.sess_binary_protocol => On => On +memcached.sess_consistent_hash => On => On +memcached.sess_consistent_hash_type => ketama => ketama memcached.sess_number_of_replicas => 0 => 0 -memcached.sess_randomize_replica_read => no value => no value -memcached.sess_remove_failed_servers => no value => no value +memcached.sess_randomize_replica_read => Off => Off +memcached.sess_remove_failed_servers => Off => Off memcached.sess_server_failure_limit => 0 => 0 -memcached.sess_connect_timeout => 1000 => 1000 +memcached.sess_connect_timeout => 0 => 0 memcached.sess_sasl_username => no value => no value memcached.sess_sasl_password => no value => no value +memcached.sess_persistent => Off => Off memcached.sess_prefix => memc.sess.key. => memc.sess.key. -memcached.sess_persistent => no value => no value memcached.sess_lock_wait => not set => not set memcached.sess_lock_max_wait => not set => not set memcached.compression_type => fastlz => fastlz @@ -34,6 +35,6 @@ memcached.compression_factor => 1.3 => 1.3 memcached.compression_threshold => 2000 => 2000 memcached.serializer => igbinary => igbinary memcached.store_retry_count => 2 => 2 -memcached.default_consistent_hash => no value => no value -memcached.default_binary_protocol => no value => no value +memcached.default_consistent_hash => Off => Off +memcached.default_binary_protocol => Off => Off memcached.default_connect_timeout => 0 => 0 diff --git a/REFLECTION b/REFLECTION index 5841930..9d7f852 100644 --- a/REFLECTION +++ b/REFLECTION @@ -1,4 +1,4 @@ -Extension [ extension #188 memcached version 3.0.4 ] { +Extension [ extension #189 memcached version 3.1.0 ] { - Dependencies { Dependency [ session (Required) ] @@ -12,10 +12,10 @@ Extension [ extension #188 memcached version 3.0.4 ] { Current = '1' } Entry [ memcached.sess_lock_wait_min ] - Current = '1000' + Current = '150' } Entry [ memcached.sess_lock_wait_max ] - Current = '2000' + Current = '150' } Entry [ memcached.sess_lock_retries ] Current = '5' @@ -29,20 +29,23 @@ Extension [ extension #188 memcached version 3.0.4 ] { Entry [ memcached.sess_consistent_hash ] Current = '1' } + Entry [ memcached.sess_consistent_hash_type ] + Current = 'ketama' + } Entry [ memcached.sess_number_of_replicas ] Current = '0' } Entry [ memcached.sess_randomize_replica_read ] - Current = '' + Current = '0' } Entry [ memcached.sess_remove_failed_servers ] - Current = '' + Current = '0' } Entry [ memcached.sess_server_failure_limit ] Current = '0' } Entry [ memcached.sess_connect_timeout ] - Current = '1000' + Current = '0' } Entry [ memcached.sess_sasl_username ] Current = '' @@ -50,12 +53,12 @@ Extension [ extension #188 memcached version 3.0.4 ] { Entry [ memcached.sess_sasl_password ] Current = '' } + Entry [ memcached.sess_persistent ] + Current = '0' + } Entry [ memcached.sess_prefix ] Current = 'memc.sess.key.' } - Entry [ memcached.sess_persistent ] - Current = '' - } Entry [ memcached.sess_lock_wait ] Current = 'not set' } @@ -78,10 +81,10 @@ Extension [ extension #188 memcached version 3.0.4 ] { Current = '2' } Entry [ memcached.default_consistent_hash ] - Current = '' + Current = '0' } Entry [ memcached.default_binary_protocol ] - Current = '' + Current = '0' } Entry [ memcached.default_connect_timeout ] Current = '0' @@ -91,7 +94,7 @@ Extension [ extension #188 memcached version 3.0.4 ] { - Classes [3] { Class [ class Memcached ] { - - Constants [132] { + - Constants [133] { Constant [ public integer LIBMEMCACHED_VERSION_HEX ] { 16777240 } Constant [ public integer OPT_COMPRESSION ] { -1001 } Constant [ public integer OPT_COMPRESSION_TYPE ] { -1004 } @@ -102,6 +105,7 @@ Extension [ extension #188 memcached version 3.0.4 ] { Constant [ public boolean HAVE_IGBINARY ] { 1 } Constant [ public boolean HAVE_JSON ] { 1 } Constant [ public boolean HAVE_MSGPACK ] { 1 } + Constant [ public boolean HAVE_ENCODING ] { 1 } Constant [ public boolean HAVE_SESSION ] { 1 } Constant [ public boolean HAVE_SASL ] { 1 } Constant [ public integer OPT_HASH ] { 2 } @@ -235,7 +239,7 @@ Extension [ extension #188 memcached version 3.0.4 ] { - Properties [0] { } - - Methods [57] { + - Methods [58] { Method [ public method __construct ] { - Parameters [2] { @@ -681,6 +685,13 @@ Extension [ extension #188 memcached version 3.0.4 ] { } } + Method [ public method setEncodingKey ] { + + - Parameters [1] { + Parameter #0 [ $key ] + } + } + Method [ public method isPersistent ] { - Parameters [0] { diff --git a/php-pecl-memcached.spec b/php-pecl-memcached.spec index add4c0c..92d180c 100644 --- a/php-pecl-memcached.spec +++ b/php-pecl-memcached.spec @@ -30,16 +30,13 @@ Summary: Extension to work with the Memcached caching daemon Name: %{?sub_prefix}php-pecl-memcached -Version: 3.0.4 -Release: 8%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} +Version: 3.1.0 +Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} License: PHP URL: http://pecl.php.net/package/%{pecl_name} Source0: http://pecl.php.net/get/%{pecl_name}-%{version}.tgz -Patch0: https://patch-diff.githubusercontent.com/raw/php-memcached-dev/php-memcached/pull/330.patch -Patch1: https://github.com/php-memcached-dev/php-memcached/commit/8bfdbcc9063dafcb25fdb1d1705e07ee027d7379.patch - BuildRequires: %{?dtsprefix}gcc BuildRequires: %{?scl_prefix}php-devel >= 7 BuildRequires: %{?scl_prefix}php-pear @@ -150,9 +147,6 @@ sed -e 's/role="test"/role="src"/' \ -i package.xml cd NTS -%patch0 -p1 -b .pr330 -%patch1 -p1 -b .up - %if %{with_fastlz} rm -r fastlz sed -e '/name=.fastlz/d' -i ../package.xml @@ -356,6 +350,9 @@ exit $ret %changelog +* Fri Dec 21 2018 Remi Collet - 3.1.0-1 +- update to 3.1.0 + * Tue Nov 20 2018 Remi Collet - 3.0.4-8 - rebuild using libmemcached-opt for EL -- cgit