forked from websupport-sk/pecl-memcache
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
1 parent
b94e46f
commit 10dd0df
Showing
4 changed files
with
144 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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. | ||
|
@@ -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="/"> | ||
|
@@ -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" /> | ||
|
@@ -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> | ||
|
@@ -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) | ||
|
@@ -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) | ||
|
@@ -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> | ||
|
@@ -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 | ||
|
@@ -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> | ||
|
@@ -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 | ||
|
@@ -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> | ||
|
@@ -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're now able to get multiple items with one get() call, | ||
1) Added multi get support (i.e. you'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> | ||
|
@@ -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'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> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'); | ||
} | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |