©
This document uses PHP Chinese website manual Release
(PECL memcached >= 0.1.5)
Memcached::getVersion — 获取服务器池中所有服务器的版本信息
Memcached::getVersion() 返回一个包含所有可用memcached服务器版本信息的数组。 (译注:经实验,服务器池中有不可用服务器时,返回false)
此函数没有参数。
服务器版本信息的数组,每个服务器占一项。
Example #1 Memcached::getVersion() 示例
<?php
$m = new Memcached ();
$m -> addServer ( 'localhost' , 11211 );
print_r ( $m -> getVersion ());
?>
以上例程的输出类似于:
Array ( [localhost:11211] => 1.2.6 )
[#1] Mads Madsen [2013-03-01 21:50:02]
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.