예제 #1
0
 /**
  * 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;
     }
 }
예제 #2
0
파일: Redis.php 프로젝트: pan269/php-webim
 function logout($client_id)
 {
     $this->redis->del(self::$prefix . 'client_', $client_id);
     $this->redis->sRemove(self::$prefix . 'online', $client_id);
 }
예제 #3
0
 function delAllMessages()
 {
     $this->redis->del(self::$prefix . 'Messages');
 }
예제 #4
0
 /**
  * 清除频率计数
  * @param $key
  * @return bool
  */
 function reset($key)
 {
     $key = self::PREFIX . $key;
     return $this->redis->del($key);
 }
예제 #5
0
 /**
  * 天梯表演秀关联表初始化
  * @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);
     }
 }