Redis使用


一、定義

redis是nosql產品之一,nosql就是無需編寫復雜的sql語句。是Remote Dictionary Server(遠程字典數據服務)的縮寫。

由意大利人 antirez(Salvatore Sanfilippo)  開發的一款 內存高速緩存數據庫。該軟件使用C語言編寫,它的數據模型為 key-value。

它支持豐富的數據結構(類型),比如 String  list  hash   set  sorted set

可持久化(隨時把數據備份到硬盤中一份),保證了數據安全。

簡單應用場景:同一個select 查詢語句,每天需要被執行查詢100萬次(獲得數據數據其實都是一樣的,只是在做重復的查詢工作而已),為了減輕數據庫的負載,就把查詢好的數據給緩存起來(存儲在內存中),每天的第一個用戶的第一次查詢就從mysql中獲得數據並存儲到內存中,第二個 到 第100萬次請求就直接從內存中獲得數據。

作用:  

  使用緩存減輕數據庫的負載。

  在開發網站的時候如果有一些數據在短時間之內不會發生變化,而它們還要被頻繁訪問,為了提高用戶的請求速度和降低網站的負載,就把這些數據放到一個讀取速度更快的介質上(或者是通過較少的計算量就可以獲得該數據) ,該行為就稱作對該數據的緩存。

緩存的兩種形式:(一些不常更新的數據)

  ①頁面緩存經常用在CMS(content manage system)內存管理系統里邊(Smarty緩存),如新聞類信息

  ②數據緩存經常會用在頁面的具體數據里邊

二、安裝 跳轉

linux下簡單使用:

三、具體使用

redis中的數據模型為:key/value。
類似在php中的定義變量:名稱 = 值。
1.key的操作
在redis里邊,除了”\n”和空格不能作為名字的組成內容外,其他內容都可以作為key的名字部分。名字長度不做要求。

linux中使用:

新增模糊刪除:redisCliPath keys "*keywords" | xargs redisCliPath del

php中使用:

//連接本地redis服務
$redis = new Redis();
//var_dump($redis);die;
$redis->connect('127.0.0.1',6379);
echo 'Connect to server successfully.<br>';

//查看redis服務是否在運行
echo ' Server is running '.$redis->ping();
echo '<br><br>';

echo '設置key:'.$redis->set('demo','123');
echo '<br>';
echo '測試指定key是否存在:'.$redis->exists('demo');
echo '<br>';
echo '刪除給定key:'.$redis->del('demo','demo1');
echo '<br>';
echo '返回給定key的value類型:'.$redis->type('demo');
echo '<br>';
echo '返回匹配指定模式的所有key(*模糊查找全部;*a*模糊查找;?;[];\):';
var_dump($redis->keys('*'));
var_dump($redis->keys('d*mo'));
var_dump($redis->keys('d?mo'));
var_dump($redis->keys('d[ea]mo'));
echo '<br>';
echo '改名字:'.$redis->rename('demo1','demo11');
echo '<br>';
echo '返回當前數據庫的key數量:'.$redis->dbsize();
echo '<br>';
echo '為key指定過期時間:'.$redis->expire('demo','30');
echo '<br>';
echo '返回key的剩余過期秒數:'.$redis->ttl('demo');
echo '<br>';
echo '選擇數據庫(redis一共有16個數據庫可同時操作,名字0-15。配置文件中databases值):'.$redis->select('0');
echo '<br>';
echo '將key從當前數據庫移動到指定數據庫:'.$redis->move('demo','1');
echo '<br>';
echo '刪除當前數據庫中所有的key:'.$redis->flushdb();
echo '<br>';
echo '刪除所有數據庫中的所有key:'.$redis->flushall();
echo '<br>';

  輸出

Connect to server successfully.
Server is running +PONG

設置key:1
測試指定key是否存在:1

返回給定key的value類型:1
返回匹配指定模式的所有key(*模糊查找全部;*a*模糊查找;?;[];\):array(1) {[0]=>string(4) "demo" } array(1) {[0]=>string(4) "demo" } array(1) {[0]=>string(4) "demo" } array(1) {[0]=>string(4) "demo" } 
改名字:
返回當前數據庫的key數量:1
為key指定過期時間:1
返回key的剩余過期秒數:30
選擇數據庫(redis一共有16個數據庫可同時操作,名字0-15。配置文件中databases值):1
將key從當前數據庫移動到指定數據庫:1
刪除當前數據庫中所有的key:1
刪除所有數據庫中的所有key:1

2.string的操作

  redis最基本的類型,可以包含任何數據。包括jpg圖片或者序列化的對象。單個value值最大上限是1G字節。

linux下使用:

 php中使用:

//連接本地redis服務
$redis = new Redis();
//var_dump($redis);die;
$redis->connect('127.0.0.1',6379);
echo 'Connect to server successfully.<br>';

//查看redis服務是否在運行
echo ' Server is running '.$redis->ping();
echo '<br><br>';

echo '設置key的value值:'.$redis->set('demo','0');
echo '<br>';
echo '一次設置多個key的值:'.$redis->mset(array('first_key'=>'first_val','second_key'=>'second_val','third_key'=>'third_val'));
echo '<br>';
echo '一次獲取多個key的值:';
var_dump($redis->mget(array('first_key','second_key','third_key')));
echo '<br>';
echo '對key的值做++操作,並返回新的值:'.$redis->incr('demo');
echo '<br>';
echo '對key的值做--操作,並返回新的值:'.$redis->decr('demo');
echo '<br>';
echo '對key+指定的值:'.$redis->incrby('demo','5');
echo '<br>';
echo '對key-指定的值:'.$redis->decrby('demo','4');
echo '<br>';
echo '給指定key的字符串追加value:'.$redis->append('demo','2');
echo '<br>';
echo '返回截取過的key的字符串值:'.$redis->substr('demo','0','1');

  輸出

Connect to server successfully.
Server is running +PONG

設置key的value值:1
一次設置多個key的值:1
一次獲取多個key的值:
array(3) {[0]=>string(9) "first_val"[1]=>string(10) "second_val"[2]=>string(9) "third_val" } 
對key的值做++操作,並返回新的值:1
對key的值做--操作,並返回新的值:0
對key+指定的值:5
對key-指定的值:1
給指定key的字符串追加value:2
返回截取過的key的字符串值:12

注意:

incr :  increment 增加操作,類似程序的i++,累加1操作,

   ① 這對新key操作,創建該key,並設置值為1。

   ② 針對已有key操作,已有key的信息只進行累加(要求:已有key的值類型必須為整型)。

decr: decrement  遞減操作, i--,與incr相反。

substr: key  開始位置  結尾位置(字符串的下標從0開始,截取的內容包括開始、結尾位置)。

 3.數據類型list鏈表的操作

  list類型其實就是一個雙向鏈表。通過push,pop操作從鏈表的頭部或者尾部添加刪除元素。  

  這使得list既可以用作棧,也可以用作隊列。

    上進上出 :  ,特點:數據 先進后出。

    上進下出 :隊列,特點:數據 先進先出。

linux下使用:

 php下使用:

echo '在key對用的list的頭部添加字符串元素:'.$redis->lpush('list-info','0');
echo '<br>';
echo '從list的尾部刪除元素,並返回刪除的元素:'.$redis->rpop('list-info');
echo '<br>';
echo '對應list的長度,key不存在返回0;如果key對應類型不是list返回錯誤:'.$redis->llen('list-info');
echo '<br>';
echo '返回指定區間內的元素,下標從0開始:';
var_dump($redis->lrange('list-info','0','1'));
echo '<br>';
echo '在key對用的list的尾部添加字符串元素:'.$redis->rpush('list-info','9');
echo '<br>';
echo '從list的頭部刪除元素,並返回刪除元素:'.$redis->lpop('list-info');
echo '<br>';
echo '截取list,保留指定區間內元素:';
var_dump($redis->ltrim('list-info','0','1'));

  輸出

Connect to server successfully.
 Server is running +PONG

在key對用的list的頭部添加字符串元素:1
從list的尾部刪除元素,並返回刪除的元素:0
對應list的長度,key不存在返回0;如果key對應類型不是list返回錯誤:0
返回指定區間內的元素,下標從0開始:array(0) { } 
在key對用的list的尾部添加字符串元素:1
從list的頭部刪除元素,並返回刪除元素:9
截取list,保留指定區間內元素:bool(true) 

例如:該list鏈表類型應用場合:獲得最新的10個登錄用戶信息: select * from user order by logintime desc limit 10;

以往sql語句就可以實現這個需求,但是數據多的時候,全部數據都要受到影響查詢,對數據庫的負載比較高。必要情況還需要給關鍵字段(id或logintime)設置索引,索引也比較耗費系統資源。

如果通過list鏈表實現以上功能,可以在list鏈表中只保留最新的10個數據,每進來一個新數據就刪除一個舊數據。每次就可以從鏈表中直接獲得需要的數據。極大節省各方面資源消耗。

 

最終,通過list鏈表保存登錄系統的最新10個用戶信息。

php簡單實現:

//簡單的登入系統,保存最新的10個用戶信息
$list_arr = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n'];
foreach($list_arr as $v){
    $len = $redis->llen('newLogin');
    if($len == 0){
        $redis->lpush('newLogin',$v);
    }elseif ($len === false) {
        echo 'newLogin 錯誤';
    }elseif($len == 10){
        //已滿足10個用戶,刪除最老的,再添加
        $redis->rpop('newLogin');
        $redis->lpush('newLogin',$v);
    }else {
        $redis->lpush('newLogin',$v);
    }
}
var_dump($redis->lrange('newLogin','0','100'));

  輸出

Connect to server successfully.
 Server is running +PONG

array(10) {[0]=>string(1) "n"[1]=>string(1) "m"[2]=>string(1) "l"[3]=>string(1) "k"[4]=>string(1) "j"[5]=>string(1) "i"[6]=>string(1) "h"[7]=>string(1) "g"[8]=>string(1) "f"[9]=>string(1) "e" } 

 4.set集合類型的操作

  redis的set是string類型的無序集合。set元素最大可以包含(2的32次方-1)(整型最大值)個元素。

linus下使用:

php下使用:

echo '添加一個string元素到key對應的set集合中,成功返回1;如果元素已經存在集合中,返回0;key對應的set不存在則返回錯誤:'.$redis->sadd('set-key1','member');
$redis->sadd('set-key2','member1');
echo '<br>';
echo '從key對應set中移除給定元素,成功返回1:'.$redis->srem('set-key1','member');
echo '<br>';
echo '從p1對應set中移除member並添加到p2對應的集合中:'.$redis->smove('set-key1','set-key2','member');
echo '<br>';
echo '返回set的元素個數:'.$redis->scard('set-key1');
echo '<br>';
echo '判斷member是否在set中:'.$redis->sismember('set-key1','member');
echo '<br>';
echo '返回所有給定key的交集:';
var_dump($redis->sinter('set-key1','set-key2'));
echo '<br>';
echo '返回所有給定key的並集:';
var_dump($redis->sunion('set-key1','set-key2'));
echo '<br>';
echo '返回所有給定key的差集:';
var_dump($redis->sdiff('set-key1','set-key2'));
echo '<br>';
echo '返回key對應set的所有元素,結果是無序的:';
var_dump($redis->smembers('set-key1'));

  輸出

Connect to server successfully.
 Server is running +PONG

添加一個string元素到key對應的set集合中,成功返回1;如果元素已經存在集合中,返回0;key對應的set不存在則返回錯誤:1
從key對應set中移除給定元素,成功返回1:1
從p1對應set中移除member並添加到p2對應的集合中:
返回set的元素個數:0
判斷member是否在set中:
返回所有給定key的交集:array(0) { } 
返回所有給定key的並集:array(1) {[0]=>string(7) "member1" } 
返回所有給定key的差集:array(0) { } 
返回key對應set的所有元素,結果是無序的:array(0) { } 

關於set集合類型除了基本的添加、刪除操作,其他有用的操作還包含集合的取並集(union)交集(intersection)差集(difference)。每個集合的元素不能重復。

例如:通過這些操作可以很容易的實現sns中的好友推薦功能。qq好友推薦。

  tom朋友圈(與某某是好友):mary  jack  xiaoming  wang5  wang6。

  linken朋友圈(與某某是好友):yuehan  daxiong  luce  wang5  wang6。

php簡單實現:

//好友推薦功能
$tom_s = ['mary','jack','xiaoming','wang5','wang6'];
$linken_s = ['yuehan','daxiong','luce','wang5','wang6'];
//添加集合
foreach($tom_s as $v){
    $redis->sadd('tom_s',$v);
}
foreach($linken_s as $v){
    $redis->sadd('linken_s',$v);
}
$sinter = $redis->sinter('tom_s','linken_s');
if(!empty($sinter)){
    //說明有共同好友
    //求tom_s對linken_s的差集
    $toms_d = $redis->sdiff('tom_s','linken_s');
    if(!empty($toms_d)){
        foreach($toms_d as $v){
            $redis->smove('tom_s','linken_s',$v);
        }
    }
    $linkens_d = $redis->sdiff('linken_s','tom_s');
    if(!empty($linkens_d)){
        foreach($linkens_d as $v){
            $redis->smove('linken_s','tom_s',$v);
        }
    }
}
var_dump($redis->smembers('tom_s'));
var_dump($redis->smembers('linken_s'));

  輸出

Connect to server successfully.
 Server is running +PONG

array(8) {[0]=>string(8) "xiaoming"[1]=>string(4) "luce"[2]=>string(6) "yuehan"[3]=>string(4) "mary"[4]=>string(7) "daxiong"[5]=>string(5) "wang5"[6]=>string(4) "jack"[7]=>string(5) "wang6" } 
array(2) {[0]=>string(5) "wang5"[1]=>string(5) "wang6" } 

可以看到,最后已經將linken的好友推薦給了tom。

 5.Sort Set排序集合類型的操作

  該Sort Set是兩種類型(list和set)的集中體現,稱為排序集合類型。和set一樣sorted set也是string類型元素的集合,不同的是每個元素都會關聯一個。通過權/值可以有序的獲取集合中的元素。(注意,這里的值可以理解為數據庫中的id

   區別:

    list:鏈表類型,排序功能,允許重復數據。

    set:集合類型,沒有排序功能,沒有重復數據。

linux下使用:

php下使用:

echo '添加元素到集合,元素在集合中存在則更新對應的score(權)(key,權,值):'.$redis->zadd('sort-key','1','id');
echo '<br>';
echo '刪除指定元素,1表示成功,如果元素不存在返回0:'.$redis->zrem('sort-key','id1');
echo '<br>';
echo '按照incr幅度增加對應member的score(權)值,返回score(權)值:'.$redis->zincrby('sort-key','1','id');
echo '<br>';
echo '返回指定元素在集合中的排名(下標),集合中元素是按score(權)從小到大排序的:'.$redis->zrank('sort-key','id');
echo '<br>';
echo '同上,但是集合中的元素是按score(權)從大到小排序:'.$redis->zrevrank('sort-key','id');
echo '<br>';
echo '類似lrange操作從集合中去指定區間的元素,返回的是帶有 score 值(可選)的有序結果集:';
var_dump($redis->zrange('sort-key','0','1'));
echo '<br>';
echo '同上,但是返回的結果集是按score(權)逆序的:';
var_dump($redis->zrevrange('sort-key','0','1'));
echo '<br>';
echo '返回ScoreSet集合元素總數:'.$redis->zcard('sort-key');
echo '<br>';
echo '返回給定元素對應的score(權):'.$redis->zscore('sort-key','id');
echo '<br>';
echo '刪除集合中排名在給定區間的元素:'.$redis->zremrangebyrank('sort-key','0','1');

  輸出

Connect to server successfully.
 Server is running +PONG

添加元素到集合,元素在集合中存在則更新對應的score(權):1
刪除指定元素,1表示成功,如果元素不存在返回0:0
按照incr幅度增加對應member的score(權)值,返回score(權)值:2
返回指定元素在集合中的排名(下標),集合中元素是按score(權)從小到大排序的:0
同上,但是集合中的元素是按score(權)從大到小排序:0
類似lrange操作從集合中去指定區間的元素,返回的是有序結果集:array(1) {[0]=>string(4) "val1" } 
同上,但是返回的結果集是按score(權)逆序的:array(1) {[0]=>string(4) "val1" } 
返回集合元素個數:1
返回給定元素對應的score(權):2
刪除集合中排名在給定區間的元素:1

eg.獲得最熱門(回復量)前5個帖子信息:

  ①. select * from message order by backnum desc limit 5;此需求可以通過簡單sql語句實現,但是sql語句比較耗費mysql數據庫資源。

  ②. 利用sort set實現獲取最熱門的前5帖子信息

每個帖子都有機會進入該“熱門帖子集合”中,但是只保留回復量最高的5個帖子。

排序集合中的每個元素都是值(id)、權(value)的組合(之前的set集合類型每個元素就只是一個 值)

我們只做一個sort set排序集合,里邊只保留5個元素信息,該5個元素是回復量最高的,每個帖子被回復的時候,都有機會進入該集合里邊,但是只有回復量最高的前5個帖子會存在於在集合,回復量低的就被刪除。

php簡單實現:

//獲得最熱門(回復量)前5個帖子信息:
$data = [
    ['id'=>11,'value'=>102],
    ['id'=>12,'value'=>141],
    ['id'=>13,'value'=>72],
    ['id'=>14,'value'=>203],
    ['id'=>15,'value'=>189],
    ['id'=>16,'value'=>191],
    ['id'=>17,'value'=>159],
    ['id'=>18,'value'=>305],
    ['id'=>19,'value'=>184]];
//創建一個hotmsg的排序集合
foreach($data as $v){
    $redis->zadd('hotmsg',$v['value'],$v['id']);
    $count = $redis->zcard('hotmsg');
    if($count > 5){
        //按照’權‘由大到小順序,獲取元素信息
        $redis->zrevrange('hotmsg','0','100');
        //每增加一個新元素,就刪除一個權值最小的舊元素,保留權值最高的5個元素
        $redis->zremrangebyrank('hotmsg','0','0');
    }
}
var_dump($redis->zrevrange('hotmsg','0','100'));

  輸出

Connect to server successfully.
 Server is running +PONG

array(5) {[0]=>string(2) "18"[1]=>string(2) "14"[2]=>string(2) "16"[3]=>string(2) "15"[4]=>string(2) "19" } 

6. hash(哈希)數據類型的操作 

  Redis hash 是一個string類型的field和value的映射表,存儲的數據與mysql數據庫中存儲的一條記錄極為相似,所以hash特別適合用於存儲對象。

linux下使用:

php下使用:

$redis->del('hash-key');
echo '設置 hash field 為指定值,如果 key 不存在,則先創建:'.$redis->hset('hash-key','field','value');
echo '<br>';
echo '獲取指定的 hash field:'.$redis->hget('hash-key','field');
echo '<br>';
echo '獲取全部指定的 hash field:';
var_dump($redis->hmget('hash-key',['field']));
echo '<br>';
echo '同時設置 hash 的多個 field,已存在會自動更新:'.$redis->hmset('hash-key',['field1'=>'value1','field2'=>'value2','field3'=>'3']);
echo '<br>';
echo '將指定的 hash field 加上給定值:'.$redis->hincrby('hash-key','field3',1);
echo '<br>';
echo '測試指定 field 是否存在:'.$redis->hexists('hash-key','field');
echo '<br>';
echo '刪除指定的 hash fied :'.$redis->hdel('hash-key','field');
echo '<br>';
echo '返回指定 hash 的 field 數量:'.$redis->hlen('hash-key');
echo '<br>';
echo '返回 hash 的所有 field:';
var_dump($redis->hkeys('hash-key'));
echo '<br>';
echo '返回 hash 的所有 value:';
var_dump($redis->hvals('hash-key'));
echo '<br>';
echo '返回 hash 的所有 field 和 value:';
var_dump($redis->hgetall('hash-key'));

  輸出 

Connect to server successfully.
 Server is running +PONG

設置 hash field 為指定值,如果 key 不存在,則先創建:1
獲取指定的 hash field:value
獲取全部指定的 hash field:array(1) {["field"]=>string(5) "value" } 
同時設置 hash 的多個 field:1
將指定的 hash field 加上給定值:4
測試指定 field 是否存在:1
刪除指定的 hash fied :1
返回指定 hash 的 field 數量:3
返回 hash 的所有 field:array(3) {[0]=>string(6) "field1"[1]=>string(6) "field2"[2]=>string(6) "field3" } 
返回 hash 的所有 value:array(3) {[0]=>string(6) "value1"[1]=>string(6) "value2"[2]=>string(1) "4" } 
返回 hash 的所有 field 和 value:array(3) {["field1"]=>string(6) "value1"["field2"]=>string(6) "value2"["field3"]=>string(1) "4" } 

四、持久化功能

   定義:redis(nosql產品)為了內部數據的安全考慮,會把本身的數據以文件形式保存到硬盤中一份,在服務器重啟之后會自動把硬盤的數據恢復到內存(redis)的里邊。數據保存到硬盤的過程就稱為“持久化”效果。

1. snap shotting快照持久化

  該持久化默認開啟,一次性把redis中全部的數據保存一份存儲在硬盤中(備份文件名字默認是dump.rdb),如果數據非常多(10-20G)就不適合頻繁進行該持久化操作。

dump.rdb 是隨着linux系統重新啟動的時候,數據自動還原到redis內存的。

配置文件redis.conf下:

save 900 1 #900 秒內如果超過 1 個 key 被修改,則發起快照保存。

save 300 10 #300秒超過10個key被修改,發起快照。

save 60 10000 #60秒超過10000個key被修改,發起快照。

以上3個save,都要使用:
  key變化的非常快,就使用第3個save,保證數據安全
  key變化的比較慢,就使用第1/2個save,保證服務器性能

 1.1 手動發起快照持久化

[root@vbox-nginx redis]# ./redis-cli bgsave

2. append only file (AOF精細持久化)

  本質:把用戶執行的每個“寫”指令(添加、修改、刪除)都備份到文件中,還原數據的時候就是執行具體寫指令而已。

 

在配置redis.conf文件下:

# appendfsync always //每次收到寫命令就立即強制寫入磁盤,最慢的,但是保證完全的持久化,不推薦使用

appendfsync everysec //每秒鍾強制寫入磁盤一次,在性能和持久化方面做了很好的折中,推薦

# appendfsync no //完全依賴 os,性能最好,持久化沒保證

 區別:

  第一種:數據最安全,服務器性能最低
  第二種:數據較安全,服務器性能較好 推薦
  第三種:數據最不安全,服務器性能最好

注意,aof持久化修改配置文件開啟時,要先停掉舊進程,然后根據最新的額配置啟動新進程

寫好的信息會立即備份到文件中:

2.1 為aof備份文件做優化壓縮處理

  例如:可以把多個incr指令換為一個set指令

[root@vbox-nginx redis]# ./redis-cli bgrewriteaof
Background append only file rewriting started

redis持久化相關指令:

  bgsave 異步保存數據到磁盤(快照保存)

  lastsave 返回上次成功保存到磁盤的unix時間戳

  shutdown 同步保存到服務器並關閉redis服務器

  bgrewriteaof 當日志文件過長時優化AOF日志文件存儲

  ./redis-cli bgrewriteaof

  ./redis-cli bgsave

  ./redis-cli -h 127.0.0.1 -p 6379 bgsave #手動發起快照

 五、redis的主從模式

  背景:網站運行,mysql的寫入、讀取操作的sql語句比例:1:7。mysql為了降低每個服務器負載,可以設置讀寫分離(有寫服務器、有讀取服務器)

   redis實現:

    為了降低每個redis服務器的負載,可以多設置幾個,並做主從模式 。
    一個服務器負載“寫”(添加、修改、刪除)數據,其他服務器負載“讀”數據。
    主服務器數據會“自動”同步給從服務器。

在redis.conf下配置:

 六、php與redis

因為redis在php中本身就是一個功能模塊,所以在安裝好擴展的前提下,只需實例化就可以調用了。另外想查看php-redis都有哪些方法,可以使用php的 反射Reflection 進行查看。

$redis_action = new ReflectionClass('Redis');
print_r($redis_action->getMethods());

  輸出

Connect to server successfully.
 Server is running +PONG

Array ([0] => ReflectionMethod Object([name] => __construct[class] => Redis)[1] => ReflectionMethod Object([name] => __destruct[class] => Redis)[2] => ReflectionMethod Object([name] => _prefix[class] => Redis)[3] => ReflectionMethod Object([name] => _serialize[class] => Redis)[4] => ReflectionMethod Object([name] => _unserialize[class] => Redis)[5] => ReflectionMethod Object([name] => append[class] => Redis)[6] => ReflectionMethod Object([name] => auth[class] => Redis)[7] => ReflectionMethod Object([name] => bgSave[class] => Redis)[8] => ReflectionMethod Object([name] => bgrewriteaof[class] => Redis)[9] => ReflectionMethod Object([name] => bitcount[class] => Redis)[10] => ReflectionMethod Object([name] => bitop[class] => Redis)[11] => ReflectionMethod Object([name] => bitpos[class] => Redis)[12] => ReflectionMethod Object([name] => blPop[class] => Redis)[13] => ReflectionMethod Object([name] => brPop[class] => Redis)[14] => ReflectionMethod Object([name] => brpoplpush[class] => Redis)[15] => ReflectionMethod Object([name] => bzPopMax[class] => Redis)[16] => ReflectionMethod Object([name] => bzPopMin[class] => Redis)[17] => ReflectionMethod Object([name] => clearLastError[class] => Redis)[18] => ReflectionMethod Object([name] => client[class] => Redis)[19] => ReflectionMethod Object([name] => close[class] => Redis)[20] => ReflectionMethod Object([name] => command[class] => Redis)[21] => ReflectionMethod Object([name] => config[class] => Redis)[22] => ReflectionMethod Object([name] => connect[class] => Redis)[23] => ReflectionMethod Object([name] => dbSize[class] => Redis)[24] => ReflectionMethod Object([name] => debug[class] => Redis)[25] => ReflectionMethod Object([name] => decr[class] => Redis)[26] => ReflectionMethod Object([name] => decrBy[class] => Redis)[27] => ReflectionMethod Object([name] => delete[class] => Redis)[28] => ReflectionMethod Object([name] => discard[class] => Redis)[29] => ReflectionMethod Object([name] => dump[class] => Redis)[30] => ReflectionMethod Object([name] => echo[class] => Redis)[31] => ReflectionMethod Object([name] => eval[class] => Redis)[32] => ReflectionMethod Object([name] => evalsha[class] => Redis)[33] => ReflectionMethod Object([name] => exec[class] => Redis)[34] => ReflectionMethod Object([name] => exists[class] => Redis)[35] => ReflectionMethod Object([name] => expireAt[class] => Redis)[36] => ReflectionMethod Object([name] => flushAll[class] => Redis)[37] => ReflectionMethod Object([name] => flushDB[class] => Redis)[38] => ReflectionMethod Object([name] => geoadd[class] => Redis)[39] => ReflectionMethod Object([name] => geodist[class] => Redis)[40] => ReflectionMethod Object([name] => geohash[class] => Redis)[41] => ReflectionMethod Object([name] => geopos[class] => Redis)[42] => ReflectionMethod Object([name] => georadius[class] => Redis)[43] => ReflectionMethod Object([name] => georadius_ro[class] => Redis)[44] => ReflectionMethod Object([name] => georadiusbymember[class] => Redis)[45] => ReflectionMethod Object([name] => georadiusbymember_ro[class] => Redis)[46] => ReflectionMethod Object([name] => get[class] => Redis)[47] => ReflectionMethod Object([name] => getAuth[class] => Redis)[48] => ReflectionMethod Object([name] => getBit[class] => Redis)[49] => ReflectionMethod Object([name] => getDBNum[class] => Redis)[50] => ReflectionMethod Object([name] => getHost[class] => Redis)[51] => ReflectionMethod Object([name] => getKeys[class] => Redis)[52] => ReflectionMethod Object([name] => getLastError[class] => Redis)[53] => ReflectionMethod Object([name] => getMode[class] => Redis)[54] => ReflectionMethod Object([name] => getMultiple[class] => Redis)[55] => ReflectionMethod Object([name] => getOption[class] => Redis)[56] => ReflectionMethod Object([name] => getPersistentID[class] => Redis)[57] => ReflectionMethod Object([name] => getPort[class] => Redis)[58] => ReflectionMethod Object([name] => getRange[class] => Redis)[59] => ReflectionMethod Object([name] => getReadTimeout[class] => Redis)[60] => ReflectionMethod Object([name] => getSet[class] => Redis)[61] => ReflectionMethod Object([name] => getTimeout[class] => Redis)[62] => ReflectionMethod Object([name] => hDel[class] => Redis)[63] => ReflectionMethod Object([name] => hExists[class] => Redis)[64] => ReflectionMethod Object([name] => hGet[class] => Redis)[65] => ReflectionMethod Object([name] => hGetAll[class] => Redis)[66] => ReflectionMethod Object([name] => hIncrBy[class] => Redis)[67] => ReflectionMethod Object([name] => hIncrByFloat[class] => Redis)[68] => ReflectionMethod Object([name] => hKeys[class] => Redis)[69] => ReflectionMethod Object([name] => hLen[class] => Redis)[70] => ReflectionMethod Object([name] => hMget[class] => Redis)[71] => ReflectionMethod Object([name] => hMset[class] => Redis)[72] => ReflectionMethod Object([name] => hSet[class] => Redis)[73] => ReflectionMethod Object([name] => hSetNx[class] => Redis)[74] => ReflectionMethod Object([name] => hStrLen[class] => Redis)[75] => ReflectionMethod Object([name] => hVals[class] => Redis)[76] => ReflectionMethod Object([name] => hscan[class] => Redis)[77] => ReflectionMethod Object([name] => incr[class] => Redis)[78] => ReflectionMethod Object([name] => incrBy[class] => Redis)[79] => ReflectionMethod Object([name] => incrByFloat[class] => Redis)[80] => ReflectionMethod Object([name] => info[class] => Redis)[81] => ReflectionMethod Object([name] => isConnected[class] => Redis)[82] => ReflectionMethod Object([name] => lGet[class] => Redis)[83] => ReflectionMethod Object([name] => lGetRange[class] => Redis)[84] => ReflectionMethod Object([name] => lInsert[class] => Redis)[85] => ReflectionMethod Object([name] => lPop[class] => Redis)[86] => ReflectionMethod Object([name] => lPush[class] => Redis)[87] => ReflectionMethod Object([name] => lPushx[class] => Redis)[88] => ReflectionMethod Object([name] => lRemove[class] => Redis)[89] => ReflectionMethod Object([name] => lSet[class] => Redis)[90] => ReflectionMethod Object([name] => lSize[class] => Redis)[91] => ReflectionMethod Object([name] => lastSave[class] => Redis)[92] => ReflectionMethod Object([name] => listTrim[class] => Redis)[93] => ReflectionMethod Object([name] => migrate[class] => Redis)[94] => ReflectionMethod Object([name] => move[class] => Redis)[95] => ReflectionMethod Object([name] => mset[class] => Redis)[96] => ReflectionMethod Object([name] => msetnx[class] => Redis)[97] => ReflectionMethod Object([name] => multi[class] => Redis)[98] => ReflectionMethod Object([name] => object[class] => Redis)[99] => ReflectionMethod Object([name] => pconnect[class] => Redis)[100] => ReflectionMethod Object([name] => persist[class] => Redis)[101] => ReflectionMethod Object([name] => pexpire[class] => Redis)[102] => ReflectionMethod Object([name] => pexpireAt[class] => Redis)[103] => ReflectionMethod Object([name] => pfadd[class] => Redis)[104] => ReflectionMethod Object([name] => pfcount[class] => Redis)[105] => ReflectionMethod Object([name] => pfmerge[class] => Redis)[106] => ReflectionMethod Object([name] => ping[class] => Redis)[107] => ReflectionMethod Object([name] => pipeline[class] => Redis)[108] => ReflectionMethod Object([name] => psetex[class] => Redis)[109] => ReflectionMethod Object([name] => psubscribe[class] => Redis)[110] => ReflectionMethod Object([name] => pttl[class] => Redis)[111] => ReflectionMethod Object([name] => publish[class] => Redis)[112] => ReflectionMethod Object([name] => pubsub[class] => Redis)[113] => ReflectionMethod Object([name] => punsubscribe[class] => Redis)[114] => ReflectionMethod Object([name] => rPop[class] => Redis)[115] => ReflectionMethod Object([name] => rPush[class] => Redis)[116] => ReflectionMethod Object([name] => rPushx[class] => Redis)[117] => ReflectionMethod Object([name] => randomKey[class] => Redis)[118] => ReflectionMethod Object([name] => rawcommand[class] => Redis)[119] => ReflectionMethod Object([name] => renameKey[class] => Redis)[120] => ReflectionMethod Object([name] => renameNx[class] => Redis)[121] => ReflectionMethod Object([name] => restore[class] => Redis)[122] => ReflectionMethod Object([name] => role[class] => Redis)[123] => ReflectionMethod Object([name] => rpoplpush[class] => Redis)[124] => ReflectionMethod Object([name] => sAdd[class] => Redis)[125] => ReflectionMethod Object([name] => sAddArray[class] => Redis)[126] => ReflectionMethod Object([name] => sContains[class] => Redis)[127] => ReflectionMethod Object([name] => sDiff[class] => Redis)[128] => ReflectionMethod Object([name] => sDiffStore[class] => Redis)[129] => ReflectionMethod Object([name] => sInter[class] => Redis)[130] => ReflectionMethod Object([name] => sInterStore[class] => Redis)[131] => ReflectionMethod Object([name] => sMembers[class] => Redis)[132] => ReflectionMethod Object([name] => sMove[class] => Redis)[133] => ReflectionMethod Object([name] => sPop[class] => Redis)[134] => ReflectionMethod Object([name] => sRandMember[class] => Redis)[135] => ReflectionMethod Object([name] => sRemove[class] => Redis)[136] => ReflectionMethod Object([name] => sSize[class] => Redis)[137] => ReflectionMethod Object([name] => sUnion[class] => Redis)[138] => ReflectionMethod Object([name] => sUnionStore[class] => Redis)[139] => ReflectionMethod Object([name] => save[class] => Redis)[140] => ReflectionMethod Object([name] => scan[class] => Redis)[141] => ReflectionMethod Object([name] => script[class] => Redis)[142] => ReflectionMethod Object([name] => select[class] => Redis)[143] => ReflectionMethod Object([name] => set[class] => Redis)[144] => ReflectionMethod Object([name] => setBit[class] => Redis)[145] => ReflectionMethod Object([name] => setOption[class] => Redis)[146] => ReflectionMethod Object([name] => setRange[class] => Redis)[147] => ReflectionMethod Object([name] => setTimeout[class] => Redis)[148] => ReflectionMethod Object([name] => setex[class] => Redis)[149] => ReflectionMethod Object([name] => setnx[class] => Redis)[150] => ReflectionMethod Object([name] => slaveof[class] => Redis)[151] => ReflectionMethod Object([name] => slowlog[class] => Redis)[152] => ReflectionMethod Object([name] => sort[class] => Redis)[153] => ReflectionMethod Object([name] => sortAsc[class] => Redis)[154] => ReflectionMethod Object([name] => sortAscAlpha[class] => Redis)[155] => ReflectionMethod Object([name] => sortDesc[class] => Redis)[156] => ReflectionMethod Object([name] => sortDescAlpha[class] => Redis)[157] => ReflectionMethod Object([name] => sscan[class] => Redis)[158] => ReflectionMethod Object([name] => strlen[class] => Redis)[159] => ReflectionMethod Object([name] => subscribe[class] => Redis)[160] => ReflectionMethod Object([name] => swapdb[class] => Redis)[161] => ReflectionMethod Object([name] => time[class] => Redis)[162] => ReflectionMethod Object([name] => ttl[class] => Redis)[163] => ReflectionMethod Object([name] => type[class] => Redis)[164] => ReflectionMethod Object([name] => unlink[class] => Redis)[165] => ReflectionMethod Object([name] => unsubscribe[class] => Redis)[166] => ReflectionMethod Object([name] => unwatch[class] => Redis)[167] => ReflectionMethod Object([name] => wait[class] => Redis)[168] => ReflectionMethod Object([name] => watch[class] => Redis)[169] => ReflectionMethod Object([name] => xack[class] => Redis)[170] => ReflectionMethod Object([name] => xadd[class] => Redis)[171] => ReflectionMethod Object([name] => xclaim[class] => Redis)[172] => ReflectionMethod Object([name] => xdel[class] => Redis)[173] => ReflectionMethod Object([name] => xgroup[class] => Redis)[174] => ReflectionMethod Object([name] => xinfo[class] => Redis)[175] => ReflectionMethod Object([name] => xlen[class] => Redis)[176] => ReflectionMethod Object([name] => xpending[class] => Redis)[177] => ReflectionMethod Object([name] => xrange[class] => Redis)[178] => ReflectionMethod Object([name] => xread[class] => Redis)[179] => ReflectionMethod Object([name] => xreadgroup[class] => Redis)[180] => ReflectionMethod Object([name] => xrevrange[class] => Redis)[181] => ReflectionMethod Object([name] => xtrim[class] => Redis)[182] => ReflectionMethod Object([name] => zAdd[class] => Redis)[183] => ReflectionMethod Object([name] => zCard[class] => Redis)[184] => ReflectionMethod Object([name] => zCount[class] => Redis)[185] => ReflectionMethod Object([name] => zDelete[class] => Redis)[186] => ReflectionMethod Object([name] => zDeleteRangeByRank[class] => Redis)[187] => ReflectionMethod Object([name] => zDeleteRangeByScore[class] => Redis)[188] => ReflectionMethod Object([name] => zIncrBy[class] => Redis)[189] => ReflectionMethod Object([name] => zInter[class] => Redis)[190] => ReflectionMethod Object([name] => zLexCount[class] => Redis)[191] => ReflectionMethod Object([name] => zRange[class] => Redis)[192] => ReflectionMethod Object([name] => zRangeByLex[class] => Redis)[193] => ReflectionMethod Object([name] => zRangeByScore[class] => Redis)[194] => ReflectionMethod Object([name] => zRank[class] => Redis)[195] => ReflectionMethod Object([name] => zRemRangeByLex[class] => Redis)[196] => ReflectionMethod Object([name] => zRevRange[class] => Redis)[197] => ReflectionMethod Object([name] => zRevRangeByLex[class] => Redis)[198] => ReflectionMethod Object([name] => zRevRangeByScore[class] => Redis)[199] => ReflectionMethod Object([name] => zRevRank[class] => Redis)[200] => ReflectionMethod Object([name] => zScore[class] => Redis)[201] => ReflectionMethod Object([name] => zUnion[class] => Redis)[202] => ReflectionMethod Object([name] => zscan[class] => Redis)[203] => ReflectionMethod Object([name] => zPopMax[class] => Redis)[204] => ReflectionMethod Object([name] => zPopMin[class] => Redis)[205] => ReflectionMethod Object([name] => del[class] => Redis)[206] => ReflectionMethod Object([name] => evaluate[class] => Redis)[207] => ReflectionMethod Object([name] => evaluateSha[class] => Redis)[208] => ReflectionMethod Object([name] => expire[class] => Redis)[209] => ReflectionMethod Object([name] => keys[class] => Redis)[210] => ReflectionMethod Object([name] => lLen[class] => Redis)[211] => ReflectionMethod Object([name] => lindex[class] => Redis)[212] => ReflectionMethod Object([name] => lrange[class] => Redis)[213] => ReflectionMethod Object([name] => lrem[class] => Redis)[214] => ReflectionMethod Object([name] => ltrim[class] => Redis)[215] => ReflectionMethod Object([name] => mget[class] => Redis)[216] => ReflectionMethod Object([name] => open[class] => Redis)[217] => ReflectionMethod Object([name] => popen[class] => Redis)[218] => ReflectionMethod Object([name] => rename[class] => Redis)[219] => ReflectionMethod Object([name] => sGetMembers[class] => Redis)[220] => ReflectionMethod Object([name] => scard[class] => Redis)[221] => ReflectionMethod Object([name] => sendEcho[class] => Redis)[222] => ReflectionMethod Object([name] => sismember[class] => Redis)[223] => ReflectionMethod Object([name] => srem[class] => Redis)[224] => ReflectionMethod Object([name] => substr[class] => Redis)[225] => ReflectionMethod Object([name] => zRem[class] => Redis)[226] => ReflectionMethod Object([name] => zRemRangeByRank[class] => Redis)[227] => ReflectionMethod Object([name] => zRemRangeByScore[class] => Redis)[228] => ReflectionMethod Object([name] => zRemove[class] => Redis)[229] => ReflectionMethod Object([name] => zRemoveRangeByScore[class] => Redis)[230] => ReflectionMethod Object([name] => zReverseRange[class] => Redis)[231] => ReflectionMethod Object([name] => zSize[class] => Redis)[232] => ReflectionMethod Object([name] => zinterstore[class] => Redis)[233] => ReflectionMethod Object([name] => zunionstore[class] => Redis) ) 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM