Skip to content

Commit

Permalink
Release memcache 3.0.9
Browse files Browse the repository at this point in the history
Note that the memcache-3.0.8 git branch is a completely different history from
the RELEASE_3.0.6 git tag.

Tests are passing locally with gcc 5.4.0 and php 5.6.40 on NTS non-debug.
(with and without Valgrind)
100b was flaky in valgrind due to timing.

Tests also pass in ZTS debug with gcc 5.4.0 or gcc 9.2.0.

For websupport-sk#63
  • Loading branch information
TysonAndre-tmg committed Feb 7, 2020
1 parent b94e46f commit 10dd0df
Show file tree
Hide file tree
Showing 4 changed files with 144 additions and 20 deletions.
56 changes: 37 additions & 19 deletions package2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ http://pear.php.net/dtd/package-2.0.xsd">
<channel>pecl.php.net</channel>
<summary>memcached extension</summary>
<description>
Memcached is a caching daemon designed especially for
dynamic web applications to decrease database load by
Memcached is a caching daemon designed especially for
dynamic web applications to decrease database load by
storing objects in memory.
This extension allows you to work with memcached through
handy OO and procedural interfaces.
Expand Down Expand Up @@ -37,21 +37,19 @@ http://pear.php.net/dtd/package-2.0.xsd">
<email>[email protected]</email>
<active>yes</active>
</lead>
<date>2013-04-07</date>
<date>2020-02-07</date>
<version>
<release>3.0.8</release>
<api>3.0.8</api>
<release>3.0.9</release>
<api>3.0.9</api>
</version>
<stability>
<release>beta</release>
<api>beta</api>
</stability>
<license uri="http://www.php.net/license">PHP License</license>
<notes>
- Fix Bug #63142 - memcache client Segmentation fault
- Fix Bug #63272 - Explicitly reserve range of flags in php_memcache.h so application code can use
- Fix Bug #59602 - getExtendedStats fails on the host intermittently after restarting memcache
- Fix Bug #63141 - Added LICENSE file and include tests folder in package
- Backport fix for building this extension with gcc5+ to the 3.x release line.
- Backport extra helper files for running tests.
</notes>
<contents>
<dir name="/">
Expand All @@ -75,6 +73,8 @@ http://pear.php.net/dtd/package-2.0.xsd">
<file name="memcache_queue.h" role="src" />
<file name="README" role="doc" />
<file name="memcache.php" role="doc" />
<file name ="tests/connect.inc" role="test" />
<file name ="tests/memcache.sh" role="test" />
<file name ="tests/001.phpt" role="test" />
<file name ="tests/002.phpt" role="test" />
<file name ="tests/003.phpt" role="test" />
Expand Down Expand Up @@ -181,6 +181,24 @@ http://pear.php.net/dtd/package-2.0.xsd">
- Fix Bug #63141 - Added LICENSE file and include tests folder in package
</notes>
</release>
<release>
<date>2013-04-07</date>
<version>
<release>3.0.8</release>
<api>3.0.8</api>
</version>
<stability>
<release>beta</release>
<api>beta</api>
</stability>
<license uri="http://www.php.net/license">PHP License</license>
<notes>
- Fix Bug #63142 - memcache client Segmentation fault
- Fix Bug #63272 - Explicitly reserve range of flags in php_memcache.h so application code can use
- Fix Bug #59602 - getExtendedStats fails on the host intermittently after restarting memcache
- Fix Bug #63141 - Added LICENSE file and include tests folder in package
</notes>
</release>
<release>
<date>2012-09-22</date>
<version>
Expand Down Expand Up @@ -250,7 +268,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
<license uri="http://www.php.net/license">PHP License</license>
<notes>
- Improved performance of consistent hash strategy
- Accept timeout parameter as float to enable microsecond timeouts, param is still
- Accept timeout parameter as float to enable microsecond timeouts, param is still
given in seconds but with a microsecond fraction.
- Added session locking to avoid concurrency problems with AJAX apps
- Fixed PECL bug #14642 (3.0.x breaks BC with 2.2.x)
Expand All @@ -274,7 +292,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
<notes>
- Enabled compression by default for values larger than 20kb
- Scalar data types (int, bool, double) are preserved by get/set
- Reserved the lowest 2 bytes of the flags for internal use
- Reserved the lowest 2 bytes of the flags for internal use
- Fixed PECL bug #14157 (Segmentation fault with errorcallback handler)
- Fixed PECL bug #15342 (memcache keys whitespaces replace issue)
- Fixed PECL bug #15447 (Persistent Connections Cause Segfaults if One Server Drops)
Expand Down Expand Up @@ -313,7 +331,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
- Fixed PECL request #13725 (unnecessary allocations in mmc_consistent_add_server)
- Changed behaviour when unserialize/uncompress fail to return false instead of failing the server
</notes>
</release>
</release>
<release>
<date>2008-02-05</date>
<version>
Expand Down Expand Up @@ -347,9 +365,9 @@ http://pear.php.net/dtd/package-2.0.xsd">
<license uri="http://www.php.net/license">PHP License</license>
<notes>
See README for details on new API and INI directives.

- UDP support
- Binary protocol support
- Binary protocol support
- Non-blocking IO using select()
- Pipelined multi-set/delete/increment/decrement
- CAS (Compare-And-Swap) support
Expand All @@ -361,7 +379,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
memcache.protocol = {ascii, binary}
memcache.redundancy = 1
memcache.session_redundancy = 2
- Changed INI defaults
- Changed INI defaults
memcache.hash_strategy = consistent
memcache.chunk_size = 32768
</notes>
Expand Down Expand Up @@ -432,7 +450,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
<license uri="http://www.php.net/license">PHP License</license>
<notes>
- Added support for consistent hash strategy
- New INI directives
- New INI directives
"memcache.hash_strategy" = {standard, consistent}
"memcache.hash_function" = {crc32, fnv}
- PHP6 support
Expand Down Expand Up @@ -491,7 +509,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
- New methods: setServerParams(), getServerStatus()
- Statistics methods support fetching other kinds of stats (slabs, items, cachedump, ...)
- Fixed PECL bugs #7631, #8117 (erroneous line feeds in config.m4)
- Added memcache.max_failover_attempts ini directive, which can be used to configure max number of
- Added memcache.max_failover_attempts ini directive, which can be used to configure max number of
servers to try when setting and getting data.
</notes>
</release>
Expand Down Expand Up @@ -624,7 +642,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
<date>2004-12-02</date>
<license uri="http://www.php.net/license">PHP License</license>
<notes>
1) Added multi get support (i.e. you&apos;re now able to get multiple items with one get() call,
1) Added multi get support (i.e. you&apos;re now able to get multiple items with one get() call,
just pass array of keys to get() and it will return associative array of found items).
</notes>
</release>
Expand Down Expand Up @@ -691,7 +709,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
<license uri="http://www.php.net/license">PHP License</license>
<notes>
1) Ifdef&apos;ed debug routines, so they are available only in debug mode.
This should add more speed to extension.
This should add more speed to extension.
2) Minor code decorations.
</notes>
</release>
Expand Down
2 changes: 1 addition & 1 deletion php_memcache.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ PHP_FUNCTION(memcache_decrement);
PHP_FUNCTION(memcache_close);
PHP_FUNCTION(memcache_flush);

#define PHP_MEMCACHE_VERSION "3.0.8"
#define PHP_MEMCACHE_VERSION "3.0.9"

#define MMC_DEFAULT_TIMEOUT 1 /* seconds */
#define MMC_DEFAULT_RETRY 15 /* retry failed server after x seconds */
Expand Down
97 changes: 97 additions & 0 deletions tests/connect.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
<?php

if (!extension_loaded("memcache")) {
die("skip");
}

error_reporting(E_ALL);

/*
* Please change host & port to match your configuration
*/

$host = "localhost";
$port = 11211;
//$udpPort = 11211;

$host2 = "localhost";
$port2 = 11212;
//$udpPort2 = 11212;

//ini_set('memcache.hash_strategy', 'standard');
//ini_set('memcache.hash_function', 'fnv');
//ini_set('memcache.protocol', 'binary');

if (ini_get('memcache.protocol') == 'binary') {
$udpPort = 0;
$udpPort2 = 0;
}

/* Start a server listening to a unix domain socket
*
* mkdir /var/run/memcached
* chown memcached:memcached /var/run/memcached
* memcached -d -u memcached -s /var/run/memcached/memcached.sock
* chmod a+w /var/run/memcached/memcached.sock
*/
$domainsocket = 'unix:///var/run/memcached/memcached.sock';

// A server which is guaranteed to fail immediatly
$nonExistingHost = "localhost";
$nonExistingPort = 11213;

// A server which times out when attempting to connect to
$unreachableHost = '10.254.254.254';
$unreachablePort = 11211;

$udpPacketSize = 1400;

$balanceKeys = array(
'consistent' => array(
'crc32' => array('key1_abc', 'key2_abcde'),
'fnv' => array('key1_a', 'key2_2534534'),
),
'standard' => array(
'crc32' => array('load_test_key1', 'load_test_key2'),
'fnv' => array('key1_ab', 'key2_a'),
),
);

$strat = strtolower(ini_get('memcache.hash_strategy'));
$func = strtolower(ini_get('memcache.hash_function'));
list ($balanceKey1, $balanceKey2) = $balanceKeys[$strat][$func];

if (!isset($udpPort))
$udpPort = 0;
if (!isset($udpPort2))
$udpPort2 = 0;

$memcache = memcache_connect($host, $port);

function test_connect1() {
global $host, $port, $udpPort;
$memcache = new MemcachePool();
$memcache->connect($host, $port, isset($udpPort) ? $udpPort : 0);
return $memcache;
}

function test_connect2() {
global $host2, $port2, $udpPort2;
$memcache = new MemcachePool();
$memcache->connect($host2, $port2, isset($udpPort2) ? $udpPort2 : 0);
return $memcache;
}

function test_connect_pool() {
global $host, $port, $udpPort, $host2, $port2, $udpPort2;
$memcache = new MemcachePool();
$memcache->addServer($host, $port, isset($udpPort) ? $udpPort : 0);
$memcache->addServer($host2, $port2, isset($udpPort2) ? $udpPort2 : 0);
return $memcache;
}

if (!$memcache) {
die('skip Connection to memcached failed');
}

?>
9 changes: 9 additions & 0 deletions tests/memcache.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

# basic script to launch memcached for testing
memcached -p11211 -U11211 -d
memcached -p11212 -U11212 -d

# if this fails, make sure your user has permissions
# to write to /var/run/memcached
memcached -s /var/run/memcached/memcached.sock -d

0 comments on commit 10dd0df

Please sign in to comment.