/** * Delete item from the server * * CacheRedis::delete() deletes an item with tey $key. * * @param string $key The key associated with the item to delete. * @return void */ function delete($key) { $_key = $this->getKey($key); try { $this->redis->del($_key); } catch (RedisException $e) { return $this->status = false; } }
function logout($client_id) { $this->redis->del(self::$prefix . 'client_', $client_id); $this->redis->sRemove(self::$prefix . 'online', $client_id); }
function delAllMessages() { $this->redis->del(self::$prefix . 'Messages'); }
/** * 清除频率计数 * @param $key * @return bool */ function reset($key) { $key = self::PREFIX . $key; return $this->redis->del($key); }
/** * 天梯表演秀关联表初始化 * @param gid int 活动id * @param iid int 参赛记录id * @param period int 活动排期数 */ private function init_show($gid, $iid, $schedule = 1) { $this->load->model('show/ladder_show_model', 'show_mod'); $add_data = array(); $add_data['wk_id'] = $iid; $add_data['gid'] = $gid; $add_data['period'] = $schedule; #$add_data['rank'] = $rank; $add_data['uid'] = $this->uid; $up_data = array('key' => 'wk_id', 'value' => $iid); $ret = $this->show_mod->add_ladder_show($add_data, $up_data); #初始化缓存 if ($ret) { $redis = new redis(); $redis->connect(REDIS_HOST, REDIS_PORT); $top_key = "ladder_show_top_" . $gid . '_' . $schedule; $top10_key = "ladder_show_top10_" . $gid . '_' . $schedule; $redis->del($top_key); $redis->del($top10_key); } }