示例#1
0
 private function dumpCacheProfiler()
 {
     $print = "";
     $print .= Zing_Cache_ZingGlobalCache::getAllProfilerData();
     $print .= '<br><br><table border=1 cellspacing="5" cellpadding="5" style="border-collapse:collapse">' . "<tr><th colspan=4 bgcolor='#dddddd'>Caching Profiler</th></tr>" . "<tr><th width=50>No.</th><th>Key</th><th>Result</th><th>Time elapsed in secs</th>";
     $print .= "<tr><td colspan='4' align='left'><b>total hits : " . CacheProfiler::getTotalHitsCache() . "</b></td></tr>";
     $print .= "<tr><td colspan='4' align='left'><b>total percent hits : " . CacheProfiler::getPercentHitsCache() . " %</b></td></tr>";
     $print .= "<tr><td colspan='4' align='left'><b>total misses : " . CacheProfiler::getTotalMissesCache() . "</tr>";
     $print .= "<tr><td colspan='4' align='left'><b>total percent misses : " . CacheProfiler::getPercentMissesCache() . " %</b></td></tr>";
     $print .= "<tr><td colspan='4' align='left'><b>total ellapsed time by cache : " . number_format(CacheProfiler::getTotalEllapsedTime(), 9) . " secs</b></td></tr>";
     $cache_profile = CacheProfiler::getCacheProfiles();
     for ($i = 0; $i < count($cache_profile); $i++) {
         $profiler = $cache_profile[$i];
         $print .= "<tr><td>" . ($i + 1) . "</td><td>" . $profiler->key . "</td><td>" . ($profiler->result == "1" ? "<font color='green'>hit cache</font>" : "<font color='red'>miss cache</font>") . "</td><td>" . number_format($profiler->ellapsedtime, 9) . "</td></tr>";
     }
     $print .= "</table><br><br>";
     return $print;
 }
示例#2
0
 /**
  * Clears contents from storage
  *
  * @throws Zend_Auth_Storage_Exception If clearing contents from storage is impossible
  * @return void
  */
 public function clear()
 {
     $cache_key = sprintf(self::STORAGE_SESSION_CACHE_KEY, $this->_zadminauth);
     Zing_Cache_ZingGlobalCache::deleteCache($cache_key, self::CACHE_INSTANCE);
 }
示例#3
0
 public static function setCache($key, $value, $instance = '', $expireTime = 0, $compress = 0)
 {
     $cache = Zing_Cache_ZingGlobalCache::getGlobalCache($instance);
     if ($cache != null) {
         $cache->setCache($key, $value, $expireTime, $compress);
     }
 }