whoami7 - Manager
:
/
home
/
topsuzmw
/
www
/
wp-includes
/
private
/
Upload File:
files >> /home/topsuzmw/www/wp-includes/private/alt-php84-pecl-memcached_3.2.0-2.el8.zip
PK X��Zp#&S� � tests/multi_order.phptnu �[��� --TEST-- Memcached GET_PRESERVE_ORDER flag in getMulti --SKIPIF-- <?php include "skipif.inc";?> --FILE-- <?php include dirname (__FILE__) . '/config.inc'; $m = memc_get_instance (); $m->addServer (MEMC_SERVER_HOST, MEMC_SERVER_PORT); $data = array( 'foo' => 'foo-data', 'bar' => 'bar-data', 'baz' => 'baz-data', 'lol' => 'lol-data', 'kek' => 'kek-data', ); //$m->setMulti($data, 3600); foreach ($data as $k => $v) { $m->set($k, $v, 3600); } $keys = array_keys($data); $keys[] = 'zoo'; $got = $m->getMulti($keys, Memcached::GET_PRESERVE_ORDER); foreach ($got as $k => $v) { echo "$k $v\n"; } ?> --EXPECT-- foo foo-data bar bar-data baz baz-data lol lol-data kek kek-data zoo PK X��Z���e e tests/invoke_callback_twice.phptnu �[��� --TEST-- Test that callback is invoked on new object only once --SKIPIF-- <?php include "skipif.inc";?> --FILE-- <?php function my_func(Memcached $obj, $persistent_id = null) { echo "Invoked for '{$persistent_id}'\n"; } $m1 = new Memcached('foobar', 'my_func'); $m2 = new Memcached('foobar', 'my_func'); echo "OK\n"; --EXPECT-- Invoked for 'foobar' OK PK X��Z�A3� � tests/stats_hang.phptnu �[��� --TEST-- Check stats does not hang on non-blocking binary protocol --SKIPIF-- <?php include "skipif.inc";?> --FILE-- <?php include dirname (__FILE__) . '/config.inc'; $m = memc_get_instance (); $key = MEMC_SERVER_HOST . ':' . MEMC_SERVER_PORT; // Both options set means we have to reconnect to get stats $m->setOption(Memcached::OPT_NO_BLOCK, true); $m->setOption(Memcached::OPT_BINARY_PROTOCOL, true); $stats = $m->getStats(); $conns1 = $stats[$key]['total_connections']; $stats = $m->getStats(); $conns2 = $stats[$key]['total_connections']; var_dump($conns1 == $conns2); var_dump($m->getOption(Memcached::OPT_NO_BLOCK)); var_dump($m->getOption(Memcached::OPT_BINARY_PROTOCOL)); echo "OK" . PHP_EOL; // If either or both options are false no need to reconnect $m->setOption(Memcached::OPT_NO_BLOCK, false); $m->setOption(Memcached::OPT_BINARY_PROTOCOL, true); $stats = $m->getStats(); $conns1 = $stats[$key]['total_connections']; $stats = $m->getStats(); $conns2 = $stats[$key]['total_connections']; var_dump($conns1 == $conns2); var_dump($m->getOption(Memcached::OPT_NO_BLOCK)); var_dump($m->getOption(Memcached::OPT_BINARY_PROTOCOL)); echo "OK" . PHP_EOL; // If either or both options are false no need to reconnect $m->setOption(Memcached::OPT_NO_BLOCK, true); $m->setOption(Memcached::OPT_BINARY_PROTOCOL, false); $stats = $m->getStats(); $conns1 = $stats[$key]['total_connections']; $stats = $m->getStats(); $conns2 = $stats[$key]['total_connections']; var_dump($conns1 == $conns2); var_dump($m->getOption(Memcached::OPT_NO_BLOCK)); var_dump($m->getOption(Memcached::OPT_BINARY_PROTOCOL)); echo "OK" . PHP_EOL; // If either or both options are false no need to reconnect $m->setOption(Memcached::OPT_NO_BLOCK, false); $m->setOption(Memcached::OPT_BINARY_PROTOCOL, false); $stats = $m->getStats(); $conns1 = $stats[$key]['total_connections']; $stats = $m->getStats(); $conns2 = $stats[$key]['total_connections']; var_dump($conns1 == $conns2); var_dump($m->getOption(Memcached::OPT_NO_BLOCK)); var_dump($m->getOption(Memcached::OPT_BINARY_PROTOCOL)); echo "OK" . PHP_EOL; ?> --EXPECT-- bool(false) int(1) int(1) OK bool(true) int(0) int(1) OK bool(true) int(1) int(0) OK bool(true) int(0) int(0) OK PK X��Z���n n tests/incrdecr_initial.phptnu �[��� --TEST-- Memcached::increment() Memcached::decrement() with initial support --SKIPIF-- <?php include "skipif.inc";?> --FILE-- <?php include dirname (__FILE__) . '/config.inc'; $m = memc_get_instance (array ( Memcached::OPT_BINARY_PROTOCOL => true )); $m->delete('foo'); var_dump($m->increment('foo', 1, 1)); var_dump($m->increment('foo', 0)); $m->delete('foo'); var_dump($m->increment('foo', 1, 1)); var_dump($m->increment('foo', 1, 1)); var_dump($m->increment('foo', 1, 1)); var_dump($m->decrement('foo', 1, 1)); var_dump($m->decrement('foo', 0)); $m->delete('foo'); $m->deleteByKey('foo', 'foo'); var_dump($m->incrementByKey('foo', 'foo', 1, 1)); var_dump($m->incrementByKey('foo', 'foo', 0)); $m->deleteByKey('foo', 'foo'); var_dump($m->incrementByKey('foo', 'foo', 1, 1)); var_dump($m->incrementByKey('foo', 'foo', 1, 1)); var_dump($m->incrementByKey('foo', 'foo', 1, 1)); var_dump($m->decrementByKey('foo', 'foo', 1, 1)); var_dump($m->decrementByKey('foo', 'foo', 0)); $m->deleteByKey('foo', 'foo'); --EXPECT-- int(1) int(1) int(1) int(2) int(3) int(2) int(2) int(1) int(1) int(1) int(2) int(3) int(2) int(2) PK X��ZV}u�� � tests/keys_ascii.phptnu �[��� --TEST-- Test valid and invalid keys - ascii --SKIPIF-- <?php include "skipif.inc";?> --FILE-- <?php include dirname (__FILE__) . '/config.inc'; $ascii = memc_get_instance (array ( Memcached::OPT_BINARY_PROTOCOL => false, Memcached::OPT_VERIFY_KEY => false )); // libmemcached can verify keys, but these are tests are for our own // function s_memc_valid_key_ascii, so explicitly disable the checks // that libmemcached can perform. echo 'ASCII: SPACES' . PHP_EOL; var_dump ($ascii->set ('ascii key with spaces', 'this is a test')); var_dump ($ascii->getResultCode () == Memcached::RES_BAD_KEY_PROVIDED); echo 'ASCII: NEWLINE' . PHP_EOL; var_dump ($ascii->set ('asciikeywithnewline' . PHP_EOL, 'this is a test')); var_dump ($ascii->getResultCode () == Memcached::RES_BAD_KEY_PROVIDED); echo 'ASCII: EMPTY' . PHP_EOL; var_dump ($ascii->set (''/*empty key*/, 'this is a test')); var_dump ($ascii->getResultCode () == Memcached::RES_BAD_KEY_PROVIDED); echo 'ASCII: TOO LONG' . PHP_EOL; var_dump ($ascii->set (str_repeat ('1234567890', 512), 'this is a test')); var_dump ($ascii->getResultCode () == Memcached::RES_BAD_KEY_PROVIDED); echo 'ASCII: GET' . PHP_EOL; for ($i=0;$i<32;$i++) { var_dump ($ascii->get ('asciikeywithnonprintablechar-' . chr($i) . '-here')); var_dump ($ascii->getResultCode () == Memcached::RES_BAD_KEY_PROVIDED); } echo 'ASCII: SET' . PHP_EOL; for ($i=0;$i<32;$i++) { var_dump ($ascii->set ('asciikeywithnonprintablechar-' . chr($i) . '-here', 'this is a test')); var_dump ($ascii->getResultCode () == Memcached::RES_BAD_KEY_PROVIDED); } echo 'OK' . PHP_EOL; --EXPECT-- ASCII: SPACES bool(false) bool(true) ASCII: NEWLINE bool(false) bool(true) ASCII: EMPTY bool(false) bool(true) ASCII: TOO LONG bool(false) bool(true) ASCII: GET bool(false) bool(true) bool(false) bool(true) bool(false) bool(true) bool(false) bool(true) bool(false) bool(true) bool(false) bool(true) bool(false) bool(true) bool(false) bool(true) bool(false) bool(true) bool(false) bool(true) bool(false) bool(true) bool(false) bool(true) bool(false) bool(true) bool(false) bool(true) bool(false) bool(true) bool(false) bool(true) bool(false) bool(true) bool(false) bool(true) bool(false) bool(true) bool(false) bool(true) bool(false) bool(true) bool(false) bool(true) bool(false) bool(true) bool(false) bool(true) bool(false) bool(true) bool(false) bool(true) bool(false) bool(true) bool(false) bool(true) bool(false) bool(true) bool(false) bool(true) bool(false) bool(true) bool(false) bool(true) ASCII: SET bool(false) bool(true) bool(false) bool(true) bool(false) bool(true) bool(false) bool(true) bool(false) bool(true) bool(false) bool(true) bool(false) bool(true) bool(false) bool(true) bool(false) bool(true) bool(false) bool(true) bool(false) bool(true) bool(false) bool(true) bool(false) bool(true) bool(false) bool(true) bool(false) bool(true) bool(false) bool(true) bool(false) bool(true) bool(false) bool(true) bool(false) bool(true) bool(false) bool(true) bool(false) bool(true) bool(false) bool(true) bool(false) bool(true) bool(false) bool(true) bool(false) bool(true) bool(false) bool(true) bool(false) bool(true) bool(false) bool(true) bool(false) bool(true) bool(false) bool(true) bool(false) bool(true) bool(false) bool(true) OK PK X��Z^(E�y y tests/getdelayed.phptnu �[��� --TEST-- Memcached getDelayed callback --SKIPIF-- <?php include "skipif.inc";?> --FILE-- <?php include dirname (__FILE__) . '/config.inc'; $m = memc_get_instance (); $data = array( 'foo' => 'foo-data', 'bar' => 'bar-data', 'baz' => 'baz-data', 'lol' => 'lol-data', 'kek' => 'kek-data', ); foreach ($data as $k => $v) { $m->set($k, $v, 3600); } function myfunc() { $datas = func_get_args(); if (isset($datas[1])) { var_dump($datas[1]); } } $m->getDelayed(array_keys($data), true, 'myfunc'); ?> --EXPECTF-- array(4) { ["key"]=> string(3) "foo" ["value"]=> string(8) "foo-data" ["cas"]=> int(%d) ["flags"]=> int(0) } array(4) { ["key"]=> string(3) "bar" ["value"]=> string(8) "bar-data" ["cas"]=> int(%d) ["flags"]=> int(0) } array(4) { ["key"]=> string(3) "baz" ["value"]=> string(8) "baz-data" ["cas"]=> int(%d) ["flags"]=> int(0) } array(4) { ["key"]=> string(3) "lol" ["value"]=> string(8) "lol-data" ["cas"]=> int(%d) ["flags"]=> int(0) } array(4) { ["key"]=> string(3) "kek" ["value"]=> string(8) "kek-data" ["cas"]=> int(%d) ["flags"]=> int(0) }PK X��ZJ�E� tests/bad_construct.phptnu �[��� --TEST-- Memcached construct with bad arguments --SKIPIF-- <?php include "skipif.inc"; if (PHP_VERSION_ID >= 80000) die("skip PHP 7 only"); ?> --FILE-- <?php $m = new Memcached((object)array()); echo error_get_last()["message"], "\n"; var_dump($m); class extended extends Memcached { public function __construct () { } } error_reporting(E_ALL); $extended = new extended (); var_dump ($extended->setOption (Memcached::OPT_BINARY_PROTOCOL, true)); echo "OK" . PHP_EOL; --EXPECTF-- Warning: Memcached::__construct() expects parameter 1 to be string, object given in %s on line 3 Memcached::__construct() expects parameter 1 to be string, object given object(Memcached)#1 (0) { } Warning: Memcached::setOption(): Memcached constructor was not called in %s on line 14 NULL OK PK X��Z#��� � tests/incrdecr_bykey.phptnu �[��� --TEST-- Memcached::incrementByKey() Memcached::decrementByKey() --SKIPIF-- <?php include "skipif.inc";?> --FILE-- <?php include dirname (__FILE__) . '/config.inc'; $m = memc_get_instance (); echo "Not there\n"; $m->delete('foo'); var_dump($m->incrementByKey('foo', 'foo', 1)); var_dump($m->decrementByKey('foo', 'foo', 1)); var_dump($m->get('foo')); echo "Normal\n"; $m->set('foo', 1); var_dump($m->get('foo')); $m->incrementByKey('foo', 'foo'); var_dump($m->get('foo')); $m->incrementByKey('foo', 'foo', 2); var_dump($m->get('foo')); $m->decrementByKey('foo', 'foo'); var_dump($m->get('foo')); $m->decrementByKey('foo', 'foo', 2); var_dump($m->get('foo')); error_reporting(0); echo "Negative offset\n"; error_clear_last(); $m->incrementByKey('foo', 'foo', -1); echo error_get_last()["message"], "\n"; var_dump($m->get('foo')); error_clear_last(); $m->decrementByKey('foo', 'foo', -1); echo error_get_last()["message"], "\n"; var_dump($m->get('foo')); echo "Enormous offset\n"; $m->incrementByKey('foo', 'foo', 0x7f000000); var_dump($m->get('foo')); $m->decrementByKey('foo', 'foo', 0x7f000000); var_dump($m->get('foo')); --EXPECT-- Not there bool(false) bool(false) bool(false) Normal int(1) int(2) int(4) int(3) int(1) Negative offset Memcached::incrementByKey(): offset cannot be a negative value int(1) Memcached::decrementByKey(): offset cannot be a negative value int(1) Enormous offset int(2130706433) int(1) PK X��Z{6�f" " tests/gh_90.phptnu �[��� --TEST-- Test for GH #90 --SKIPIF-- <?php include "skipif.inc";?> --FILE-- <?php include dirname (__FILE__) . '/config.inc'; $memcached = memc_get_instance (array ( Memcached::OPT_BINARY_PROTOCOL => true )); // Create a key for use as a lock. If this key already exists, wait till it doesn't exist. { $key = 'LockKey'; $lockToken = mt_rand(0, mt_getrandmax()); //Random value for ownership verification while (true) { $casToken = null; $data = $memcached->get($key, $casToken); if ($memcached->getResultCode() == Memcached::RES_NOTFOUND) { if ($memcached->add($key, $lockToken, 5)) { break; } } elseif ($data === false) { if ($memcached->cas($casToken, $key, $lockToken, 5)) { break; } } //Sleep 10 milliseconds usleep(10 * 1000); } } //Do something here that requires exclusive access to this key //Effectively delete our key lock. { $casToken = null; if ($lockToken == $memcached->get($key, $casToken)) { $memcached->cas($casToken, $key, false, 1); } } //Create 10 keys and then increment them. The first value returned will be wrong. { $keyList = array(); for ($i = 0; $i < 10; $i++) { $keyList[] = $i . '_' . uniqid ('count_value_'); } $valueList = array(); foreach ($keyList as $key) { $valueList[$key] = $memcached->increment($key, 1, 1); } var_dump ($valueList); } --EXPECTF-- array(10) { ["0_%s"]=> int(1) ["1_%s"]=> int(1) ["2_%s"]=> int(1) ["3_%s"]=> int(1) ["4_%s"]=> int(1) ["5_%s"]=> int(1) ["6_%s"]=> int(1) ["7_%s"]=> int(1) ["8_%s"]=> int(1) ["9_%s"]=> int(1) } PK X��Z n�� � tests/bug_16959.phptnu �[��� --TEST-- Memcached: Bug #16959 (getMulti + BINARY_PROTOCOL problem) --SKIPIF-- <?php include "skipif.inc";?> --FILE-- <?php include dirname (__FILE__) . '/config.inc'; $cache = memc_get_instance (array ( Memcached::OPT_BINARY_PROTOCOL => true )); $cache->set('key_0', 'value0'); $cache->set('key_0_additional', 'value0_additional'); // -------------- NORMAL echo "NORMAL\n"; $keys = array( 'key_0', 'key_0_additional' ); $values = $cache->getMulti($keys); echo $cache->getResultMessage(), "\n"; echo "Values:\n"; foreach ($values as $k => $v) { var_dump($k); var_dump($v); var_dump($values[$k]); } // --------------- REVERSED KEY ORDER echo "REVERSED KEY ORDER\n"; $keys = array( 'key_0_additional', 'key_0' ); $values = $cache->getMulti($keys); echo $cache->getResultMessage(), "\n"; echo "Values:\n"; foreach ($values as $k => $v) { var_dump($k); var_dump($v); var_dump($values[$k]); } --EXPECT-- NORMAL SUCCESS Values: string(5) "key_0" string(6) "value0" string(6) "value0" string(16) "key_0_additional" string(17) "value0_additional" string(17) "value0_additional" REVERSED KEY ORDER SUCCESS Values: string(16) "key_0_additional" string(17) "value0_additional" string(17) "value0_additional" string(5) "key_0" string(6) "value0" string(6) "value0" PK X��Z��� � tests/session_regenerate.phptnu �[��� --TEST-- Session regenerate --SKIPIF-- <?php include dirname(__FILE__) . "/skipif.inc"; if (!Memcached::HAVE_SESSION) print "skip"; ?> --INI-- session.save_handler = memcached --FILE-- <?php ob_start(); include dirname (__FILE__) . '/config.inc'; ini_set ('session.save_path', MEMC_SERVER_HOST . ':' . MEMC_SERVER_PORT); var_dump(session_start()); var_dump(session_regenerate_id()); var_dump(session_regenerate_id(true)); echo "OK"; --EXPECT-- bool(true) bool(true) bool(true) OK PK X��Z�,�S� � tests/bug_16084.phptnu �[��� --TEST-- Memcached: Bug #16084 (Crash when addServers is called with an associative array) --SKIPIF-- <?php include "skipif.inc";?> --FILE-- <?php $servers = array ( 0 => array ( 'KEYHERE' => 'localhost', 11211, 3 ), ); $m = new memcached(); var_dump($m->addServers($servers)); $list = $m->getServerList(); var_dump ($list[0]["host"], $list[0]["port"]); echo "OK"; ?> --EXPECT-- bool(true) string(9) "localhost" int(11211) OK PK X��Z�� � tests/types.incnu �[��� <?php class testclass { } function memc_types_test ($m, $options) { $data = array( array('boolean_true', true), array('boolean_false', false), array('string', "just a string"), array('string_empty', ""), array('integer_positive_integer', 10), array('integer_negative_integer', -10), array('integer_zero_integer', 0), array('float_positive1', 3.912131), array('float_positive2', 1.2131E+501), array('float_positive2', 1.2131E+52), array('float_negative', -42.123312), array('float_zero', 0.0), array('null', null), array('array_empty', array()), array('array', array(1,2,3,"foo")), array('object_array_empty', (object)array()), array('object_array', (object)array("a" => "1","b" => "2","c" => "3")), array('object_dummy', new testclass()), ); foreach ($data as $key => $value) { $m->delete($key); } foreach ($data as $types) { $key = $types [0]; $value = $types [1]; $m->set($key, $value); $actual = $m->get($key); if ($value !== $actual) { if (is_object($actual)) { if ($options['ignore_object_type']) { $value = (object) (array) $value; if ($value == $actual) continue; } if ($value == $actual && get_class($value) == get_class($actual)) continue; } echo "=== {$key} ===\n"; echo "Expected: "; var_dump($value); echo "Actual: "; var_dump($actual); } } $m->flush(); if (($actual = $m->get(uniqid ('random_key_'))) !== false) { echo "Expected: null"; echo "Actual: " . gettype($actual); } } function memc_types_test_multi ($m, $options) { $data = array( 'boolean_true' => true, 'boolean_false' => false, 'string' => "just a string", 'string_empty' => "", 'string_large' => str_repeat ('abcdef0123456789', 500), 'integer_positive_integer' => 10, 'integer_negative_integer' => -10, 'integer_zero_integer' => 0, 'float_positive1' => 3.912131, 'float_positive2' => 1.2131E+52, 'float_negative' => -42.123312, 'float_zero' => 0.0, 'null' => null, 'array_empty' => array(), 'array' => array(1,2,3,"foo"), 'object_array_empty' => (object)array(), 'object_array' => (object)array('a' => 1, 'b' => 2, 'c' => 3), 'object_dummy' => new testclass(), ); foreach ($data as $key => $value) { $m->delete($key); } $m->setMulti($data); $actual = $m->getMulti(array_keys($data)); foreach ($data as $key => $value) { if ($value !== $actual[$key]) { if (is_object($value)) { if ($options['ignore_object_type']) { $value = (object) (array) $value; if ($value == $actual[$key]) continue; } if ($value == $actual[$key] && get_class($value) == get_class($actual[$key])) continue; } echo "=== $key ===\n"; echo "Expected: "; var_dump($value); echo "Actual: "; var_dump($actual[$key]); } } } PK X��Zb'�� � "