コード例 #1
0
ファイル: FileCache.php プロジェクト: goragod/kotchasan
 /**
  * อ่านแคชหลายรายการ
  *
  * @param array $keys
  * @return array
  */
 public function getItems(array $keys = array())
 {
     $resuts = array();
     foreach ($keys as $key) {
         $file = $this->fetchStreamUri($key);
         if ($this->isExpired($file)) {
             $item = new Item($key);
             $resuts[$key] = $item->set(unserialize(preg_replace('/^<\\?php\\sexit\\?>/', '', file_get_contents($file), 1)));
         }
     }
     return $resuts;
 }
コード例 #2
0
ファイル: ApcCache.php プロジェクト: goragod/kotchasan
 /**
  * อ่านแคชหลายรายการ
  *
  * @param array $keys
  * @return array
  */
 public function getItems(array $keys = array())
 {
     $resuts = array();
     $success = false;
     $values = apc_fetch($keys, $success);
     if ($success && is_array($values)) {
         foreach ($values as $key => $value) {
             $item = new Item($key);
             $resuts[$key] = $item->set($value);
         }
     }
     return $resuts;
 }
コード例 #3
0
ファイル: DbCache.php プロジェクト: goragod/kotchasan
 /**
  * ตรวจสอบว่าข้อมูลมาจาก cache หรือไม่
  *
  * @param Item $item
  * @return bool
  */
 public function usedCache(Item $item)
 {
     return $item->isHit();
 }
コード例 #4
0
 /**
  * ตรวจสอบว่าข้อมูลมาจาก cache หรือไม่
  *
  * @return bool
  */
 public function usedCache()
 {
     return $this->item->isHit();
 }