Ejemplo n.º 1
0
 /**
  * @param string $Key
  *
  * @return mixed|false
  */
 public function getValue($Key)
 {
     $this->Timing = Debugger::getTimeGap();
     if (array_key_exists($this->Partition . $Key, self::$Memory)) {
         $Value = self::$Memory[$this->Partition . $Key];
         self::$HitCount++;
         $this->Timing = number_format((Debugger::getTimeGap() - $this->Timing) * 1000, 3, ',', '');
         return $Value;
     }
     self::$MissCount++;
     $this->Timing = number_format((Debugger::getTimeGap() - $this->Timing) * 1000, 3, ',', '');
     return false;
 }
Ejemplo n.º 2
0
 /**
  * @param string $Key
  *
  * @return mixed|false
  */
 public function getValue($Key)
 {
     $this->Timing = Debugger::getTimeGap();
     if (null !== self::$Server) {
         $Value = self::$Server->get($Key);
         // 0 = MEMCACHED_SUCCESS
         if (self::$Server->getResultCode() == 0) {
             $this->Timing = number_format((Debugger::getTimeGap() - $this->Timing) * 1000, 3, ',', '');
             return $Value;
         }
     }
     $this->Timing = number_format((Debugger::getTimeGap() - $this->Timing) * 1000, 3, ',', '');
     return false;
 }