Skip to content

Commit b55106b

Browse files
committed
Merge in upstream changes from master branch of php-memcached GitHub project (e495a6b; 3.0.0 release)
2 parents 7937c7f + e495a6b commit b55106b

22 files changed

+553
-266
lines changed

.travis.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ php:
88

99
matrix:
1010
fast_finish: true
11-
allow_failures:
12-
- php: 7.1
1311

1412
env:
1513
- LIBMEMCACHED_VERSION=1.0.18 # Debian Jessie / Ubuntu Xenial
@@ -31,6 +29,4 @@ script:
3129

3230
cache:
3331
directories:
34-
- $HOME/cache
35-
36-
32+
- $HOME/cache

ChangeLog

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,44 @@
11
memcached extension changelog
22

3+
Version 3.0.0 (2017-01-27)
4+
--------------------------
5+
* Support for PHP 7.0 and PHP 7.1
6+
* Fix compiling with SASL disabled
7+
* Improved the test suite and Travis CI test runners
8+
* Fix small string compression / decompression
9+
* Fix increment/decrement with adjustments greater than 32-bit integers
10+
* Fix session.gc_maxlifetime to handle both relative and absolute times
11+
* Fix inability to reset OPT_PREFIX_KEY
12+
13+
Version 3.0.0a1 (2016-02-22)
14+
----------------------------
15+
Dependencies
16+
* Support for PHP 7.0
17+
* Requires libmemcached 1.0 or higher
18+
* Optional extension igbinary must 2.0 or higher
19+
* Optional extension msgpack must be 2.0 or higher
20+
21+
API
22+
* The method signature of get, getByKey, getMulti, and getMultiByKey changed.
23+
* get* and getMulti* commands no longer take cas or user flags parameters.
24+
* get* and getMulti* commands now take the Memcached::GET_EXTENDED flag to retrieve user flags and cas tokens.
25+
* Fixes getStats command to return all stats from all servers
26+
* Fixes allKeys command behaviour
27+
* Fixes error where cache callback for get command was not setting expiration time properly
28+
* Added server type to server list
29+
* Remove use_sasl ini-variable and initialise sasl as needed
30+
* CAS tokens are returned as integers and they overflow to strings as needed
31+
32+
Session handler
33+
* The session memcached protocol config name was changed, and the default protocol was changed from text to binary protocol. If your memcached setup does not support the binary protocol(e.g. if using twemproxy), then set memcached.sess_binary_protocol = Off. (Previously called memcached.sess_binary)
34+
* Session lock algorithm updated (new ini-values memcached.sess_lock_wait_min, memcached.sess_lock_wait_max and memcached.sess_lock_retries)
35+
* Session extension uses PHP allocators (still some work to do on the rest of the extension)
36+
* Ini-values take effect during session_start or session_regenerate_id
37+
* Fixes crash with session_regenerate_id (work-around for PHP bug)
38+
39+
Tests
40+
* Fix several problematic tests
41+
342
Version 2.2.0 (2014-04-01)
443
--------------------------
544
* Added the OPT_SERVER_TIMEOUT_LIMIT behaviour

README.markdown

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,34 @@ Note: you can statically link the libmemcached library into the PHP binary so it
8383
* [Github link] (https://github.com/awslabs/aws-elasticache-cluster-client-memcached-for-php)
8484
* [AmazonElastiCache Auto Discovery](http://docs.amazonwebservices.com/AmazonElastiCache/latest/UserGuide/AutoDiscovery.html)
8585
* [php-memcached] (https://github.com/php-memcached-dev/php-memcached)
86-
* [libmemcached](http://libmemcached.org/libMemcached.html)
87-
* [memcached](http://memcached.org/)
88-
* [igbinary](https://github.com/igbinary/igbinary7)
86+
87+
Dependencies
88+
------------
89+
90+
php-memcached 3.x:
91+
* Supports PHP 7.0 - 7.1.
92+
* Requires libmemcached 1.x or higher.
93+
* Optionally supports igbinary 2.0 or higher.
94+
* Optionally supports msgpack 2.0 or higher.
95+
96+
php-memcached 2.x:
97+
* Supports PHP 5.2 - 5.6.
98+
* Requires libmemcached 0.44 or higher.
99+
* Optionally supports igbinary 1.0 or higher.
100+
* Optionally supports msgpack 0.5 or higher.
101+
102+
[libmemcached](http://libmemcached.org/libMemcached.html) version 1.0.16 or
103+
higher is recommended for best performance and compatibility with memcached
104+
servers.
105+
106+
[igbinary](https://github.com/igbinary/igbinary) is a faster and more compact
107+
binary serializer for PHP data structures. When installing php-memcached from
108+
source code, the igbinary module must be installed first so that php-memcached
109+
can access its C header files. Load both modules in your `php.ini` at runtime
110+
to begin using igbinary.
111+
112+
[msgpack](https://msgpack.org) is a faster and more compact data structure
113+
representation that is interoperable with msgpack implementations for other
114+
languages. When installing php-memcached from source code, the msgpack module
115+
must be installed first so that php-memcached can access its C header files.
116+
Load both modules in your `php.ini` at runtime to begin using msgpack.

config.m4

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ PHP_ARG_ENABLE(memcached-sasl, whether to enable memcached sasl support,
2424
[ --disable-memcached-sasl Disable memcached sasl support], yes, no)
2525

2626
PHP_ARG_ENABLE(memcached-protocol, whether to enable memcached protocol support,
27-
[ --enable-memcached-protocol Enable memcached protocoll support], no, no)
27+
[ --enable-memcached-protocol Enable memcached protocol support], no, no)
2828

2929
PHP_ARG_WITH(system-fastlz, whether to use system FastLZ bibrary,
3030
[ --with-system-fastlz Use system FastLZ bibrary], no, no)
@@ -318,7 +318,7 @@ if test "$PHP_MEMCACHED" != "no"; then
318318
AC_DEFINE(HAVE_MEMCACHED_EXIST, [1], [Whether memcached_exist is defined])
319319
fi
320320

321-
PHP_MEMCACHED_FILES="php_memcached.c php_libmemcached_compat.c g_fmt.c"
321+
PHP_MEMCACHED_FILES="php_memcached.c g_fmt.c"
322322

323323
if test "$PHP_SYSTEM_FASTLZ" != "no"; then
324324
AC_CHECK_HEADERS([fastlz.h], [ac_cv_have_fastlz="yes"], [ac_cv_have_fastlz="no"])

memcached-api.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -200,13 +200,13 @@ class Memcached {
200200

201201
public function __construct( $persistent_id = '', $on_new_object_cb = null ) {}
202202

203-
public function get( $key, $cache_cb = null, &$cas_token = null, &$udf_flags = null ) {}
203+
public function get( $key, callable $cache_cb = null, $flags = 0) {}
204204

205-
public function getByKey( $server_key, $key, $cache_cb = null, &$cas_token = null, &$udf_flags = null ) {}
205+
public function getByKey( $server_key, $key, callable $cache_cb = null, $flags = 0 ) {}
206206

207-
public function getMulti( array $keys, &$cas_tokens = null, $flags = 0, &$udf_flags = null ) {}
207+
public function getMulti( array $keys, $flags = 0) {}
208208

209-
public function getMultiByKey( $server_key, array $keys, &$cas_tokens = null, $flags = 0, &$udf_flags = null ) {}
209+
public function getMultiByKey( $server_key, array $keys, $flags = 0) {}
210210

211211
public function getDelayed( array $keys, $with_cas = null, $value_cb = null ) {}
212212

@@ -286,7 +286,7 @@ public function getLastDisconnectedServer( ) {}
286286

287287
public function flush( $delay = 0 ) {}
288288

289-
public function getStats( ) {}
289+
public function getStats( $type = null ) {}
290290

291291
public function getVersion( ) {}
292292

package.xml

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,25 +21,25 @@ http://pear.php.net/dtd/package-2.0.xsd">
2121
<email>[email protected]</email>
2222
<active>yes</active>
2323
</lead>
24-
<date>2016-02-22</date>
24+
<date>2017-01-27</date>
2525
<version>
26-
<release>3.0.0a1</release>
26+
<release>3.0.0</release>
2727
<api>3.0.0</api>
2828
</version>
2929
<stability>
30-
<release>alpha</release>
31-
<api>alpha</api>
30+
<release>stable</release>
31+
<api>stable</api>
3232
</stability>
3333
<license uri="http://www.php.net/license">PHP</license>
3434
<notes>
3535
PHP7 release of memcached extension. Note that support for libmemcached 0.x series has been discontinued
3636
and the oldest actively tested version is 1.0.2. It is highly recommended to use version 1.0.18 of
37-
libmemcached. Please note that this is a beta release and reporting any issues would be highly appreciated
38-
before we move closer to releasing stable version.
37+
libmemcached.
3938

4039
API
41-
* get commands do not take cas or user flags parameters.
42-
* get and getMulti commands take Memcached::GET_EXTENDED flag to retrieve user flags and cas tokens
40+
* The method signature of get, getByKey, getMulti, and getMultiByKey changed.
41+
* get* and getMulti* commands no longer take cas or user flags parameters.
42+
* get* and getMulti* commands now take the Memcached::GET_EXTENDED flag to retrieve user flags and cas tokens.
4343
* Fixes getStats command to return all stats from all servers
4444
* Fixes allKeys command behaviour
4545
* Fixes error where cache callback for get command was not setting expiration time properly
@@ -48,6 +48,7 @@ API
4848
* CAS tokens are returned as integers and they overflow to strings as needed
4949

5050
Session handler
51+
* The session memcached protocol config name was changed, and the default protocol was changed from text to binary protocol. If your memcached setup does not support the binary protocol(e.g. if using twemproxy), then set memcached.sess_binary_protocol = Off. (Previously called memcached.sess_binary)
5152
* Session lock algorithm updated (new ini-values memcached.sess_lock_wait_min, memcached.sess_lock_wait_max and memcached.sess_lock_retries)
5253
* Session extension uses PHP allocators (still some work to do on the rest of the extension)
5354
* Ini-values take effect during session_start or session_regenerate_id
@@ -72,8 +73,6 @@ Tests
7273
<file role='src' name='php_memcached_private.h'/>
7374
<file role='src' name='php_memcached_session.c'/>
7475
<file role='src' name='php_memcached_session.h'/>
75-
<file role='src' name='php_libmemcached_compat.h'/>
76-
<file role='src' name='php_libmemcached_compat.c'/>
7776
<file role='src' name='php_memcached_server.h'/>
7877
<file role='src' name='php_memcached_server.c'/>
7978
<file role='src' name='g_fmt.c'/>
@@ -94,6 +93,7 @@ Tests
9493
<file role='test' name='check_if_persistent.phpt'/>
9594
<file role='test' name='check_if_pristine.phpt'/>
9695
<file role='test' name='clone.phpt'/>
96+
<file role='test' name='compression_conditions.phpt'/>
9797
<file role='test' name='compression_types.phpt'/>
9898
<file role='test' name='conf_persist.phpt'/>
9999
<file role='test' name='construct.phpt'/>
@@ -164,6 +164,8 @@ Tests
164164
<file role='test' name='session_regenerate.phpt'/>
165165
<file role='test' name='stats.phpt'/>
166166
<file role='test' name='default_behavior.phpt'/>
167+
<file role='test' name='reset_keyprefix.phpt'/>
168+
<file role='test' name='session_lock-php71.phpt'/>
167169
</dir>
168170
</dir>
169171
</contents>
@@ -176,6 +178,16 @@ Tests
176178
<min>1.4.0b1</min>
177179
</pearinstaller>
178180
</required>
181+
<optional>
182+
<extension>
183+
<name>igbinary</name>
184+
<min>2.0</min>
185+
</extension>
186+
<extension>
187+
<name>msgpack</name>
188+
<min>2.0</min>
189+
</extension>
190+
</optional>
179191
</dependencies>
180192
<providesextension>memcached</providesextension>
181193
<extsrcrelease>

php_libmemcached_compat.c

Lines changed: 0 additions & 37 deletions
This file was deleted.

php_libmemcached_compat.h

Lines changed: 0 additions & 59 deletions
This file was deleted.

0 commit comments

Comments
 (0)