/** * อ่านแคชหลายรายการ * * @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; }
/** * อ่านแคชหลายรายการ * * @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; }
/** * ตรวจสอบว่าข้อมูลมาจาก cache หรือไม่ * * @param Item $item * @return bool */ public function usedCache(Item $item) { return $item->isHit(); }
/** * ตรวจสอบว่าข้อมูลมาจาก cache หรือไม่ * * @return bool */ public function usedCache() { return $this->item->isHit(); }