method items documentation in bbn\Cache
function(string $dir = '')
{
if (self::$type) {
switch (self::$type){
case 'apc':
$all = apc_cache_info();
$list = [];
foreach ($all['cache_list'] as $a){
array_push($list, $a['info']);
}
return $list;
case 'memcache':
$list = [];
$allSlabs = $this->obj->getExtendedStats('slabs');
foreach ($allSlabs as $server => $slabs){
foreach ($slabs as $slabId => $slabMeta){
$cdump = $this->obj->getExtendedStats('cachedump',(int)$slabId);
foreach ($cdump AS $keys => $arrVal){
foreach ($arrVal AS $k => $v){
if ($k !== 'CLIENT_ERROR') {
echo array_push($list, $k);
}
}
}
}
}
return $list;
case 'files':
$cache =& $this;
$list = array_filter(
array_map(
function ($a) use ($dir) {
return ( $dir ? $dir.'/' : '' ).X::basename($a, '.bbn.cache');
}, $this->fs->getFiles($this->path.($dir ? '/'.$dir : ''))
),
function ($a) use ($cache) {
// Only gives valid cache
return $cache->has($a);
}
);
$dirs = $this->fs->getDirs($this->path.($dir ? '/'.$dir : ''));
if (\count($dirs)) {
foreach ($dirs as $d){
$res = $this->items($dir ? $dir.'/'.X::basename($d) : X::basename($d));
foreach ($res as $r){
array_push($list, $r);
}
}
}
return $list;
}
}
}
BBN is a suite of PHP and JS libraries and VueJS components - all open-source! bbn.io, build applications, the quick way
This website uses cookies to ensure you get the best experience on our website.
© 2011-2025
BBN Solutions