Skip to content

Commit

Permalink
Merge in upstream changes from master branch of php-memcached GitHub …
Browse files Browse the repository at this point in the history
…project (e495a6b; 3.0.0 release)
  • Loading branch information
malyeyev-AMZN committed Jan 31, 2017
2 parents 7937c7f + e495a6b commit b55106b
Show file tree
Hide file tree
Showing 22 changed files with 553 additions and 266 deletions.
6 changes: 1 addition & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ php:

matrix:
fast_finish: true
allow_failures:
- php: 7.1

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

cache:
directories:
- $HOME/cache


- $HOME/cache
39 changes: 39 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,44 @@
memcached extension changelog

Version 3.0.0 (2017-01-27)
--------------------------
* Support for PHP 7.0 and PHP 7.1
* Fix compiling with SASL disabled
* Improved the test suite and Travis CI test runners
* Fix small string compression / decompression
* Fix increment/decrement with adjustments greater than 32-bit integers
* Fix session.gc_maxlifetime to handle both relative and absolute times
* Fix inability to reset OPT_PREFIX_KEY

Version 3.0.0a1 (2016-02-22)
----------------------------
Dependencies
* Support for PHP 7.0
* Requires libmemcached 1.0 or higher
* Optional extension igbinary must 2.0 or higher
* Optional extension msgpack must be 2.0 or higher

API
* The method signature of get, getByKey, getMulti, and getMultiByKey changed.
* get* and getMulti* commands no longer take cas or user flags parameters.
* get* and getMulti* commands now take the Memcached::GET_EXTENDED flag to retrieve user flags and cas tokens.
* Fixes getStats command to return all stats from all servers
* Fixes allKeys command behaviour
* Fixes error where cache callback for get command was not setting expiration time properly
* Added server type to server list
* Remove use_sasl ini-variable and initialise sasl as needed
* CAS tokens are returned as integers and they overflow to strings as needed

Session handler
* 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)
* Session lock algorithm updated (new ini-values memcached.sess_lock_wait_min, memcached.sess_lock_wait_max and memcached.sess_lock_retries)
* Session extension uses PHP allocators (still some work to do on the rest of the extension)
* Ini-values take effect during session_start or session_regenerate_id
* Fixes crash with session_regenerate_id (work-around for PHP bug)

Tests
* Fix several problematic tests

Version 2.2.0 (2014-04-01)
--------------------------
* Added the OPT_SERVER_TIMEOUT_LIMIT behaviour
Expand Down
34 changes: 31 additions & 3 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,34 @@ Note: you can statically link the libmemcached library into the PHP binary so it
* [Github link] (https://github.com/awslabs/aws-elasticache-cluster-client-memcached-for-php)
* [AmazonElastiCache Auto Discovery](http://docs.amazonwebservices.com/AmazonElastiCache/latest/UserGuide/AutoDiscovery.html)
* [php-memcached] (https://github.com/php-memcached-dev/php-memcached)
* [libmemcached](http://libmemcached.org/libMemcached.html)
* [memcached](http://memcached.org/)
* [igbinary](https://github.com/igbinary/igbinary7)

Dependencies
------------

php-memcached 3.x:
* Supports PHP 7.0 - 7.1.
* Requires libmemcached 1.x or higher.
* Optionally supports igbinary 2.0 or higher.
* Optionally supports msgpack 2.0 or higher.

php-memcached 2.x:
* Supports PHP 5.2 - 5.6.
* Requires libmemcached 0.44 or higher.
* Optionally supports igbinary 1.0 or higher.
* Optionally supports msgpack 0.5 or higher.

[libmemcached](http://libmemcached.org/libMemcached.html) version 1.0.16 or
higher is recommended for best performance and compatibility with memcached
servers.

[igbinary](https://github.com/igbinary/igbinary) is a faster and more compact
binary serializer for PHP data structures. When installing php-memcached from
source code, the igbinary module must be installed first so that php-memcached
can access its C header files. Load both modules in your `php.ini` at runtime
to begin using igbinary.

[msgpack](https://msgpack.org) is a faster and more compact data structure
representation that is interoperable with msgpack implementations for other
languages. When installing php-memcached from source code, the msgpack module
must be installed first so that php-memcached can access its C header files.
Load both modules in your `php.ini` at runtime to begin using msgpack.
4 changes: 2 additions & 2 deletions config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ PHP_ARG_ENABLE(memcached-sasl, whether to enable memcached sasl support,
[ --disable-memcached-sasl Disable memcached sasl support], yes, no)

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

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

PHP_MEMCACHED_FILES="php_memcached.c php_libmemcached_compat.c g_fmt.c"
PHP_MEMCACHED_FILES="php_memcached.c g_fmt.c"

if test "$PHP_SYSTEM_FASTLZ" != "no"; then
AC_CHECK_HEADERS([fastlz.h], [ac_cv_have_fastlz="yes"], [ac_cv_have_fastlz="no"])
Expand Down
10 changes: 5 additions & 5 deletions memcached-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,13 +200,13 @@ class Memcached {

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

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

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

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

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

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

Expand Down Expand Up @@ -286,7 +286,7 @@ public function getLastDisconnectedServer( ) {}

public function flush( $delay = 0 ) {}

public function getStats( ) {}
public function getStats( $type = null ) {}

public function getVersion( ) {}

Expand Down
32 changes: 22 additions & 10 deletions package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,25 @@ http://pear.php.net/dtd/package-2.0.xsd">
<email>mkoppanen@php.net</email>
<active>yes</active>
</lead>
<date>2016-02-22</date>
<date>2017-01-27</date>
<version>
<release>3.0.0a1</release>
<release>3.0.0</release>
<api>3.0.0</api>
</version>
<stability>
<release>alpha</release>
<api>alpha</api>
<release>stable</release>
<api>stable</api>
</stability>
<license uri="http://www.php.net/license">PHP</license>
<notes>
PHP7 release of memcached extension. Note that support for libmemcached 0.x series has been discontinued
and the oldest actively tested version is 1.0.2. It is highly recommended to use version 1.0.18 of
libmemcached. Please note that this is a beta release and reporting any issues would be highly appreciated
before we move closer to releasing stable version.
libmemcached.

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

Session handler
* 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)
* Session lock algorithm updated (new ini-values memcached.sess_lock_wait_min, memcached.sess_lock_wait_max and memcached.sess_lock_retries)
* Session extension uses PHP allocators (still some work to do on the rest of the extension)
* Ini-values take effect during session_start or session_regenerate_id
Expand All @@ -72,8 +73,6 @@ Tests
<file role='src' name='php_memcached_private.h'/>
<file role='src' name='php_memcached_session.c'/>
<file role='src' name='php_memcached_session.h'/>
<file role='src' name='php_libmemcached_compat.h'/>
<file role='src' name='php_libmemcached_compat.c'/>
<file role='src' name='php_memcached_server.h'/>
<file role='src' name='php_memcached_server.c'/>
<file role='src' name='g_fmt.c'/>
Expand All @@ -94,6 +93,7 @@ Tests
<file role='test' name='check_if_persistent.phpt'/>
<file role='test' name='check_if_pristine.phpt'/>
<file role='test' name='clone.phpt'/>
<file role='test' name='compression_conditions.phpt'/>
<file role='test' name='compression_types.phpt'/>
<file role='test' name='conf_persist.phpt'/>
<file role='test' name='construct.phpt'/>
Expand Down Expand Up @@ -164,6 +164,8 @@ Tests
<file role='test' name='session_regenerate.phpt'/>
<file role='test' name='stats.phpt'/>
<file role='test' name='default_behavior.phpt'/>
<file role='test' name='reset_keyprefix.phpt'/>
<file role='test' name='session_lock-php71.phpt'/>
</dir>
</dir>
</contents>
Expand All @@ -176,6 +178,16 @@ Tests
<min>1.4.0b1</min>
</pearinstaller>
</required>
<optional>
<extension>
<name>igbinary</name>
<min>2.0</min>
</extension>
<extension>
<name>msgpack</name>
<min>2.0</min>
</extension>
</optional>
</dependencies>
<providesextension>memcached</providesextension>
<extsrcrelease>
Expand Down
37 changes: 0 additions & 37 deletions php_libmemcached_compat.c

This file was deleted.

59 changes: 0 additions & 59 deletions php_libmemcached_compat.h

This file was deleted.

Loading

1 comment on commit b55106b

@mvanbaak
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit breaks the module. I created an issue for it: #12

Please sign in to comment.