Was going mad, I figured getStatus() would return false on servers not responding. This is however not true, it will return:
array(1) {
["127.0.0.1:11112"]=>
string(11) "255.255.255"
}
On a failed connection.
(PECL memcached >= 0.1.5)
Memcached::getVersion — 获取服务器池中所有服务器的版本信息
Memcached::getVersion() 返回一个包含所有可用 memcached 服务器版本信息的数组。 (译注:经实验,服务器池中有不可用服务器时,返回 false)
此函数没有参数。
服务器版本信息的数组,每个服务器占一项。
示例 #1 Memcached::getVersion() 示例
<?php
$m = new Memcached();
$m->addServer('localhost', 11211);
print_r($m->getVersion());
?>
以上示例的输出类似于:
Array ( [localhost:11211] => 1.2.6 )
Was going mad, I figured getStatus() would return false on servers not responding. This is however not true, it will return:
array(1) {
["127.0.0.1:11112"]=>
string(11) "255.255.255"
}
On a failed connection.