当前位置: 首页>>代码示例>>PHP>>正文


PHP sendMemcacheCommand函数代码示例

本文整理汇总了PHP中sendMemcacheCommand函数的典型用法代码示例。如果您正苦于以下问题:PHP sendMemcacheCommand函数的具体用法?PHP sendMemcacheCommand怎么用?PHP sendMemcacheCommand使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了sendMemcacheCommand函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: process_item

function process_item($i)
{
    $name = $i;
    $content = sendMemcacheCommand("get {$i}");
    if (isset($content['VALUE'])) {
        $size = $content['VALUE'][$i]['stat']['size'];
        global $total_size;
        $total_size += $size;
    } else {
        $size = "?";
    }
    return array("size" => $size, "key" => $i);
}
开发者ID:raphael-riel,项目名称:workstation,代码行数:13,代码来源:memcache_dump.php

示例2: flushServer

function flushServer($server)
{
    list($host, $port) = explode(':', $server);
    $resp = sendMemcacheCommand($host, $port, 'flush_all');
    return $resp;
}
开发者ID:hartum,项目名称:basezf,代码行数:6,代码来源:memcache.php

示例3: flushServer

function flushServer($server)
{
    list($host, $port) = get_host_port_from_server($server);
    $resp = sendMemcacheCommand($host, $port, 'flush_all');
    return $resp;
}
开发者ID:xuniji258369,项目名称:ppp,代码行数:6,代码来源:memcache.php

示例4: dumpCacheSlab

function dumpCacheSlab($server, $slabId, $limit)
{
    list($host, $port) = explode(':', $server);
    $resp = sendMemcacheCommand($host, $port, 'stats cachedump ' . $slabId . ' ' . $limit);
    return $resp;
}
开发者ID:Shopatron,项目名称:mcrouter-util,代码行数:6,代码来源:memcache.php

示例5: bsize

        echo "<tr><td>", $theserver, "</td><td>", $theKey, " <br/>flag:", $r['VALUE'][$theKey]['stat']['flag'], " <br/>Size:", bsize($r['VALUE'][$theKey]['stat']['size']), "</td><td>", chunk_split($r['VALUE'][$theKey]['value'], 40), "</td>", '<td><a href="', $PHP_SELF, '&op=5&server=', (int) $_GET['server'], '&key=', base64_encode($theKey), "\">Delete</a></td>", "</tr>";
        echo <<<EOB
            </tbody></table>
            <hr/>
EOB;
        break;
    case 5:
        // item delete
        if (!isset($_GET['key']) || !isset($_GET['server'])) {
            echo "No key set!";
            break;
        }
        $theKey = htmlentities(base64_decode($_GET['key']));
        $theserver = $GLOBALS['MEMCACHE_SERVERS'][(int) $_GET['server']];
        list($h, $p) = explode(':', $theserver);
        $r = sendMemcacheCommand($h, $p, 'delete ' . $theKey);
        echo 'Deleting ' . $theKey . ' : ' . $r;
        break;
    case 6:
        // flush server
        $theserver = $GLOBALS['MEMCACHE_SERVERS'][(int) $_GET['server']];
        $r = flushServer($theserver);
        echo 'Flush  ' . $theserver . " : " . $r;
        break;
    case 7:
        // flush stats
        $theserver = $GLOBALS['MEMCACHE_SERVERS'][(int) $_GET['server']];
        $r = flushStats($theserver);
        echo 'Stats reset ' . $theserver . " : " . print_r($r, true);
        break;
    case 8:
开发者ID:rfrancis2823,项目名称:memcache.php,代码行数:31,代码来源:memcache.php

示例6: sendMemcacheCommand

        }
    }
    return $res;
}
$server = $_GET['server'];
$port = $_GET['port'];
if ($server == '') {
    $server = 'localhost';
}
if ((int) $port == 0) {
    $port = 11211;
}
$stats = sendMemcacheCommand($server, $port, "stats");
$stats = $stats['STAT'];
// calc the amount of memory designated to items of certain size
$stats_slabs = sendMemcacheCommand($server, $port, "stats slabs");
$stats_slabs = $stats_slabs['STAT'];
$slabs = array();
$below1mb = 0;
$below200k = 0;
$below50k = 0;
$below4k = 0;
$below1k = 0;
$below400b = 0;
foreach ($stats_slabs as $name => $value) {
    $parts = explode(':', $name);
    $slabs[$parts[0]][$parts[1]] = $value;
}
foreach ($slabs as $slab => $values) {
    if ($values["chunk_size"] <= 400) {
        $below400b += $values["total_pages"] * 1024 * 1024;
开发者ID:bestblast,项目名称:centos-admin,代码行数:31,代码来源:memcache.php


注:本文中的sendMemcacheCommand函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。