golden hour
/opt/alt/tests/alt-php71-pecl-memcache_4.0.5.2-1.el9/tests
⬆️ Go Up
Upload
File/Folder
Size
Actions
001.phpt
551 B
Del
OK
002.phpt
1.21 KB
Del
OK
003.phpt
1.14 KB
Del
OK
004.phpt
523 B
Del
OK
005.phpt
3.64 KB
Del
OK
006.phpt
430 B
Del
OK
007.phpt
453 B
Del
OK
008.phpt
302 B
Del
OK
009.phpt
548 B
Del
OK
010.phpt
613 B
Del
OK
011.phpt
554 B
Del
OK
012.phpt
499 B
Del
OK
013.phpt
325 B
Del
OK
014.phpt
396 B
Del
OK
015.phpt
437 B
Del
OK
016.phpt
276 B
Del
OK
017.phpt
394 B
Del
OK
018.phpt
398 B
Del
OK
019.phpt
1.62 KB
Del
OK
019a.phpt
687 B
Del
OK
020.phpt
1.29 KB
Del
OK
021.phpt
1.01 KB
Del
OK
022.phpt
1.03 KB
Del
OK
022a.phpt
1.14 KB
Del
OK
023.phpt
1.72 KB
Del
OK
024.phpt
904 B
Del
OK
024a.phpt
1.15 KB
Del
OK
025.phpt
1.23 KB
Del
OK
026.phpt
677 B
Del
OK
027.phpt
882 B
Del
OK
027a.phpt
1.84 KB
Del
OK
028.phpt
358 B
Del
OK
029.phpt
1.32 KB
Del
OK
030.phpt
557 B
Del
OK
031.phpt
2.26 KB
Del
OK
032.phpt
2.01 KB
Del
OK
033.phpt
3.88 KB
Del
OK
034.phpt
1.63 KB
Del
OK
035.phpt
775 B
Del
OK
036.phpt
1.5 KB
Del
OK
036b.phpt
1.46 KB
Del
OK
037.phpt
486 B
Del
OK
038.phpt
851 B
Del
OK
039.phpt
790 B
Del
OK
041.phpt
1 KB
Del
OK
042.phpt
1.12 KB
Del
OK
043.phpt
1.68 KB
Del
OK
044.phpt
1.84 KB
Del
OK
045.phpt
842 B
Del
OK
046.phpt
1.64 KB
Del
OK
047.phpt
1.36 KB
Del
OK
048.phpt
728 B
Del
OK
049.phpt
709 B
Del
OK
050.phpt
706 B
Del
OK
051.phpt
590 B
Del
OK
052.phpt
611 B
Del
OK
053.phpt
988 B
Del
OK
054.phpt
573 B
Del
OK
055.phpt
769 B
Del
OK
056.phpt
1.56 KB
Del
OK
057.phpt
1.17 KB
Del
OK
058.phpt
213 B
Del
OK
100.phpt
954 B
Del
OK
100a.phpt
1.04 KB
Del
OK
100b.phpt
1.29 KB
Del
OK
bug73539.phpt
906 B
Del
OK
connect.inc
2.3 KB
Del
OK
githubbug13.phpt
465 B
Del
OK
memcache.sh
255 B
Del
OK
pecl11221.phpt
490 B
Del
OK
pecl16442.phpt
361 B
Del
OK
pecl16536.phpt
342 B
Del
OK
pecl17518.phpt
714 B
Del
OK
pecl17566.phpt
353 B
Del
OK
pecl63142.phpt
722 B
Del
OK
Edit: 033.phpt
--TEST-- memcache->addServer() with server failure callback --SKIPIF-- <?php include 'connect.inc'; if (!isset($host2)) die('skip $host2 not set'); ?> --FILE-- <?php include 'connect.inc'; function _callback_server_failure($host, $tcp_port, $udp_port, $error, $errnum) { var_dump($host); var_dump($tcp_port); var_dump($udp_port); var_dump($error); var_dump($errnum); global $memcache; $memcache->setServerParams($host, $tcp_port, 1, -1, false, '_callback_server_failure'); } // Test function callback using addServer() $memcache = new Memcache(); $memcache->addServer($nonExistingHost, $nonExistingPort, false, 1, 1, 15, true, '_callback_server_failure'); $result1 = $memcache->set('test_key', 'test-032-01'); var_dump($result1); class MemcachedFailureHandler { function _callback_server_failure($host, $tcp_port, $udp_port, $error, $errnum) { var_dump($host); var_dump($tcp_port); var_dump($udp_port); var_dump($error); var_dump($errnum); } } // Test OO callback using setServerParams() $memcache = new Memcache(); $memcache->addServer($nonExistingHost, $nonExistingPort, false); $result2 = $memcache->setServerParams($nonExistingHost, $nonExistingPort, 1, 15, true, array(new MemcachedFailureHandler(), '_callback_server_failure')); var_dump($result2); $result3 = $memcache->set('test_key', 'test-032-01'); var_dump($result3); // Test giving non-existing callback to addServer() $memcache = new Memcache(); $result4 = @$memcache->addServer($nonExistingHost, $nonExistingPort, false, 1, 1, 15, true, 'non_existing_user_function'); var_dump($result4); // Test giving non-existing callback to setServerParams() $memcache = new Memcache(); $memcache->addServer($nonExistingHost, $nonExistingPort, false); $result5 = @$memcache->setServerParams($nonExistingHost, $nonExistingPort, 1, 15, true, 'non_existing_user_function'); var_dump($result5); // Test self-referencing callback class MyMemcache extends Memcache { function _callback_server_failure($host, $tcp_port, $udp_port, $error, $errnum) { var_dump($host); } } $memcache = new MyMemcache(); $memcache->addServer($nonExistingHost, $nonExistingPort, false); $result6 = $memcache->setServerParams($nonExistingHost, $nonExistingPort, 1, 15, true, array($memcache, '_callback_server_failure')); $result7 = @$memcache->set('test_key', 'test-032-01'); var_dump($result6); var_dump($result7); // Test resetting callback to null $memcache = new Memcache(); $memcache->addServer($nonExistingHost, $nonExistingPort, false, 1, 1, 15, true, '_callback_server_failure'); $result8 = $memcache->setServerParams($nonExistingHost, $nonExistingPort, 1, 15, true, null); $result9 = @$memcache->set('test_key', 'test-032-01'); var_dump($result8); var_dump($result9); // Test MemcachePool::setFailureCallback() function _callback_server_failure2($host, $tcp_port, $udp_port, $error, $errnum) { var_dump($error); } $memcache = new MemcachePool(); $memcache->addServer($nonExistingHost, $nonExistingPort); $result8 = $memcache->setFailureCallback('_callback_server_failure2'); $result9 = @$memcache->set('test_key', 'test-032-01'); var_dump($result8); var_dump($result9); $result8 = $memcache->setFailureCallback(null); $result9 = @$memcache->set('test_key', 'test-032-01'); var_dump($result8); var_dump($result9); // Test refcount function test_connect() { global $mc, $nonExistingHost, $nonExistingPort; $mc = new Memcache(); $mc->addServer($nonExistingHost, $nonExistingPort, false, 1, 1, 15, true, '_callback_server_failure2'); } test_connect(); $result10 = $mc->set('test_key', 'test-032-02'); var_dump($result10); ?> --EXPECTF-- string(%d) "%s" int(%d) int(%d) string(%d) "Connection %s" int(%d) bool(false) bool(true) string(%d) "%s" int(%d) int(%d) string(%d) "Connection %s" int(%d) bool(false) bool(false) bool(false) string(%d) "%s" bool(true) bool(false) bool(true) bool(false) string(%d) "%s" bool(true) bool(false) bool(true) bool(false) string(%d) "Connection %s" bool(false)
Save