get() public method

读取缓存
public get ( string $name ) : mixed
$name string 缓存变量名
return mixed
Ejemplo n.º 1
0
 /**
  * Count how often the given event occured, within the current cache-timeframe.
  *
  * @param SystemEvent $evt
  * @throws Exception
  *
  * @return int The number of equal-hashed events
  */
 public function count(SystemEvent $evt)
 {
     if (empty($evt->hash)) {
         throw new Exception("Hash is not expected to be empty!");
     }
     if ($this->dataStatistics->supported()) {
         return $this->dataStatistics->get(self::CACHE_NAMESPACE . $evt->hash, 0);
     }
     // when APC is not supported, return approx. value
     return count($this->findByHash($evt->hash));
 }