本文整理汇总了PHP中parseMemcacheResults函数的典型用法代码示例。如果您正苦于以下问题:PHP parseMemcacheResults函数的具体用法?PHP parseMemcacheResults怎么用?PHP parseMemcacheResults使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了parseMemcacheResults函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sendMemcacheCommand
function sendMemcacheCommand($server, $port, $command)
{
$s = @fsockopen($server, $port);
if (!$s) {
die("Cant connect to:" . $server . ':' . $port);
}
fwrite($s, $command . "\r\n");
$buf = '';
while (!feof($s)) {
$buf .= fgets($s, 256);
if (strpos($buf, "END\r\n") !== false) {
// stat says end
break;
}
if (strpos($buf, "DELETED\r\n") !== false || strpos($buf, "NOT_FOUND\r\n") !== false) {
// delete says these
break;
}
if (strpos($buf, "OK\r\n") !== false) {
// flush_all says ok
break;
}
}
fclose($s);
return parseMemcacheResults($buf);
}
示例2: sendMemcacheCommand
function sendMemcacheCommand($server, $port, $command)
{
$s = fsockopen($server, $port);
if (!$s) {
die("Cant connect to:" . $server . ':' . $port);
}
fwrite($s, $command . "\r\n");
$buf = '';
while (!feof($s) && strpos($buf, "END\r\n") === false) {
$buf .= fgets($s, 256);
}
fclose($s);
return parseMemcacheResults($buf);
}