note 98161 added to memcache.getextendedstats
| From: | manmca dot 2280 at gmail dot com | Date: | Fri, 28 May 2010 23:35:13 +0000 |
| Subject: | note 98161 added to memcache.getextendedstats | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-169702@lists.php.net to get a copy of this message | ||
Get lists of all the keys stored in memcache server....
/**
* Function to get all memcache keys
* @author Manish Patel
* @Created: 28-May-2010
*/
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');
$items = $memcache->getExtendedStats('items');
foreach($allSlabs as $server => $slabs) {
foreach($slabs AS $slabId => $slabMeta) {
$cdump = $memcache->getExtendedStats('cachedump',(int)$slabId);
foreach($cdump AS $keys => $arrVal) {
foreach($arrVal AS $k => $v) {
echo $k .'<br>';
}
}
}
}
}//EO getMemcacheKeys()
Hope it helps....
----
Server IP: 64.71.164.2
Probable Submitter: 64.0.147.226
----
Manual Page -- http://www.php.net/manual/en/memcache.getextendedstats.php
Edit -- https://master.php.net/note/edit/98161
Del: integrated -- https://master.php.net/note/delete/98161/integrated
Del: useless -- https://master.php.net/note/delete/98161/useless
Del: bad code -- https://master.php.net/note/delete/98161/bad+code
Del: spam -- https://master.php.net/note/delete/98161/spam
Del: non-english -- https://master.php.net/note/delete/98161/non-english
Del: in docs -- https://master.php.net/note/delete/98161/in+docs
Del: other reasons-- https://master.php.net/note/delete/98161
Reject -- https://master.php.net/note/reject/98161
Search -- https://master.php.net/manage/user-notes.php