LonghornPHP 2026

Voting

: three plus five?
(Example: nine)

The Note You're Voting On

Anonymous
8 years ago
the latest updated version:

function getMemcacheKeys() {

    $memcache = new Memcache;
    $memcache->connect('127.0.0.1', 11211) or die ("Could not connect to memcache server");

    $list = array();
    $allSlabs = $memcache->getExtendedStats('slabs');
    foreach($allSlabs as $server => $slabs) {
        foreach($slabs AS $slabId => $slabMeta) {
           if (!is_int($slabId)) { continue; }
           $cdump = $memcache->getExtendedStats('cachedump',(int)$slabId);
            foreach($cdump AS $keys => $arrVal) {
                if (!is_array($arrVal)) continue;
                foreach($arrVal AS $k => $v) {                   
                    $list[] =  $k;
                }
           }
        }
    } 
    return $list;  
}

<< Back to user notes page

To Top