/** * Save data into cache. * * @param string $id Cache id * @param mixed $data Data to put in the cache * @param int $opt Cache::% options */ public function set($id, $data, $opt = 0) { $this->doSet($id, $data, $opt); if (isset($this->chainNext) && ~$opt & self::NOCASCADE) { $this->chainNext->set($data); } }
public function set($key = '', $value = '', $duration = 0) { if ($this->aliasToRedis) { $myCacher = new Cacher($key, Cacher::STORAGE_REDIS); return $myCacher->set($value, $duration); } else { return false; } }
private function saveToCache() { Cacher::set(FEED_CACHE_KEY, $this->data, FEED_EXPIRE_TIME); }
private function markUpToDate() { if ($this->isRecentArticle()) { Cacher::set($this->upToDateKey, '1', ARTICLE_REFRESH_TIME); } }
private function saveToCache() { Cacher::set(INDEX_CACHE_KEY, $this->data, INDEX_EXPIRE_TIME); }
public function banipRemove($ipaddress) { if ($this->isMemoryCacheEnable()) { $myCacher = new Cacher(self::PHPIDS_BANNEDIP_KEY); $list = $myCacher->get(); if (empty($list)) { return false; } else { $newlist = array(); foreach ($list as $ip) { if ($ip != $ipaddress) { $newlist[] = $ip; } } return $myCacher->set($newlist, 0); } } else { return false; } }