Source of file MemcachedStatsTask.php
Size: 0,830 Bytes - Last Modified: 2021-12-23T10:26:52+00:00
/var/www/docs.ssmods.com/process/src/code/tasks/MemcachedStatsTask.php
1234567891011121314151617181920212223242526272829303132333435363738394041 | <?php /** * @author marcus@silverstripe.com.au * @license BSD License http://silverstripe.org/bsd-license/ */ class MemcachedStatsTask extends BuildTask { public function run($request) { $config = SimpleCache::$cache_configs; foreach ($config as $name => $conf) { if ($conf['store_type'] == 'SimpleMemcacheBasedCacheStore') { $cache = singleton('SimpleCache')->get_cache($name); $store = $cache->getStore()->getUnderlyingCache(); $stats = $store->getStats(); echo $this->printOut($stats); } } } function printOut($arr) { if (!is_array($arr)) { return $arr; } $lines = array(); foreach ($arr as $key => $val) { $lines[] = "<tr><td>$key </td><td>" . $this->printOut($val) . "</td></tr>"; } return '<table>' . implode("\n", $lines) . '</table>'; } } |