@@ -521,7 +521,7 @@ public function lSize($key) {}
521
521
public function lIndex ($ key , $ index ) {}
522
522
523
523
/**
524
- * @see lIndex
524
+ * @see lIndex()
525
525
*/
526
526
public function lGet ($ key , $ index ) {}
527
527
@@ -561,7 +561,7 @@ public function lSet($key, $index, $value) {}
561
561
public function lRange ($ key , $ start , $ end ) {}
562
562
563
563
/**
564
- * @see lRange
564
+ * @see lRange()
565
565
*/
566
566
public function lGetRange ($ key , $ start , $ end ) {}
567
567
@@ -585,7 +585,7 @@ public function lGetRange($key, $start, $end) {}
585
585
public function lTrim ($ key , $ start , $ stop ) {}
586
586
587
587
/**
588
- * @see lTrim
588
+ * @see lTrim()
589
589
*/
590
590
public function listTrim ($ key , $ start , $ stop ) {}
591
591
@@ -677,7 +677,7 @@ public function sAdd($key, $value) {}
677
677
public function sRem ($ key , $ member ) {}
678
678
679
679
/**
680
- * @see sRem
680
+ * @see sRem()
681
681
*/
682
682
public function sRemove ($ key , $ member ) {}
683
683
@@ -719,7 +719,7 @@ public function sMove($srcKey, $dstKey, $member) {}
719
719
public function sIsMember ($ key , $ value ) {}
720
720
721
721
/**
722
- * @see sIsMember
722
+ * @see sIsMember()
723
723
*/
724
724
public function sContains ($ key , $ value ) {}
725
725
@@ -901,23 +901,190 @@ public function sUnion($key1, $key2, $keyN) {}
901
901
*/
902
902
public function sUnionStore ($ dstKey , $ key1 , $ key2 , $ keyN ) {}
903
903
904
+ /**
905
+ * Performs the difference between N sets and returns it.
906
+ *
907
+ * @param string $key1 Any number of keys corresponding to sets in redis.
908
+ * @param string $key2 ...
909
+ * @param string $keyN ...
910
+ * @return Array of strings: The difference of the first set will all the others.
911
+ * @example
912
+ * $redis->delete('s0', 's1', 's2');
913
+ *
914
+ * $redis->sAdd('s0', '1');
915
+ * $redis->sAdd('s0', '2');
916
+ * $redis->sAdd('s0', '3');
917
+ * $redis->sAdd('s0', '4');
918
+ *
919
+ * $redis->sAdd('s1', '1');
920
+ * $redis->sAdd('s2', '3');
921
+ *
922
+ * var_dump($redis->sDiff('s0', 's1', 's2'));
923
+ *
924
+ * //array(2) {
925
+ * // [0]=>
926
+ * // string(1) "4"
927
+ * // [1]=>
928
+ * // string(1) "2"
929
+ * //}
930
+ */
931
+ public function sDiff ($ key1 , $ key2 , $ keyN ) {}
904
932
933
+ /**
934
+ * Performs the same action as sDiff, but stores the result in the first key
935
+ *
936
+ * @param string $dstKey the key to store the diff into.
937
+ * @param string $key1 Any number of keys corresponding to sets in redis
938
+ * @param string $key2 ...
939
+ * @param string $keyN ...
940
+ * @return INTEGER: The cardinality of the resulting set, or FALSE in case of a missing key.
941
+ * @example
942
+ * $redis->delete('s0', 's1', 's2');
943
+ *
944
+ * $redis->sAdd('s0', '1');
945
+ * $redis->sAdd('s0', '2');
946
+ * $redis->sAdd('s0', '3');
947
+ * $redis->sAdd('s0', '4');
948
+ *
949
+ * $redis->sAdd('s1', '1');
950
+ * $redis->sAdd('s2', '3');
951
+ *
952
+ * var_dump($redis->sDiffStore('dst', 's0', 's1', 's2'));
953
+ * var_dump($redis->sMembers('dst'));
954
+ *
955
+ * //int(2)
956
+ * //array(2) {
957
+ * // [0]=>
958
+ * // string(1) "4"
959
+ * // [1]=>
960
+ * // string(1) "2"
961
+ * //}
962
+ */
963
+ public function sDiffStore ($ dstKey , $ key1 , $ key2 , $ keyN ) {}
905
964
965
+ /**
966
+ * Returns the contents of a set.
967
+ *
968
+ * @param type $key
969
+ * @return An array of elements, the contents of the set.
970
+ * @example
971
+ * $redis->delete('s');
972
+ * $redis->sAdd('s', 'a');
973
+ * $redis->sAdd('s', 'b');
974
+ * $redis->sAdd('s', 'a');
975
+ * $redis->sAdd('s', 'c');
976
+ * var_dump($redis->sMembers('s'));
977
+ *
978
+ * //array(3) {
979
+ * // [0]=>
980
+ * // string(1) "c"
981
+ * // [1]=>
982
+ * // string(1) "a"
983
+ * // [2]=>
984
+ * // string(1) "b"
985
+ * //}
986
+ * // The order is random and corresponds to redis' own internal representation of the set structure.
987
+ */
988
+ public function sMembers ($ key ) {}
906
989
990
+ /**
991
+ * @see sMembers()
992
+ */
993
+ public function sGetMembers ($ key ) {}
907
994
995
+ /**
996
+ * Sets a value and returns the previous entry at that key.
997
+ *
998
+ * @param string $key
999
+ * @param string $value
1000
+ * @return A string, the previous value located at this key.
1001
+ * @example
1002
+ * $redis->set('x', '42');
1003
+ * $exValue = $redis->getSet('x', 'lol'); // return '42', replaces x by 'lol'
1004
+ * $newValue = $redis->get('x')' // return 'lol'
1005
+ */
1006
+ public function getSet ($ key , $ value ) {}
908
1007
1008
+ /**
1009
+ * Returns a random key.
1010
+ *
1011
+ * @return STRING: an existing key in redis.
1012
+ * @example
1013
+ * $key = $redis->randomKey();
1014
+ * $surprise = $redis->get($key); // who knows what's in there.
1015
+ */
1016
+ public function randomKey () {}
909
1017
910
1018
1019
+ /**
1020
+ * Switches to a given database.
1021
+ *
1022
+ * @param int $dbindex
1023
+ * @return TRUE in case of success, FALSE in case of failure.
1024
+ * @example
1025
+ * $redis->select(0); // switch to DB 0
1026
+ * $redis->set('x', '42'); // write 42 to x
1027
+ * $redis->move('x', 1); // move to DB 1
1028
+ * $redis->select(1); // switch to DB 1
1029
+ * $redis->get('x'); // will return 42
1030
+ */
1031
+ public function select ($ dbindex ) {}
911
1032
1033
+ /**
1034
+ * Moves a key to a different database.
1035
+ *
1036
+ * @param string $key
1037
+ * @param int $dbindex
1038
+ * @return BOOL: TRUE in case of success, FALSE in case of failure.
1039
+ * @example
1040
+ * $redis->select(0); // switch to DB 0
1041
+ * $redis->set('x', '42'); // write 42 to x
1042
+ * $redis->move('x', 1); // move to DB 1
1043
+ * $redis->select(1); // switch to DB 1
1044
+ * $redis->get('x'); // will return 42
1045
+ */
1046
+ public function move ($ key , $ dbindex ) {}
912
1047
1048
+ /**
1049
+ * Renames a key.
1050
+ *
1051
+ * @param string $srcKey
1052
+ * @param string $dstKey
1053
+ * @return BOOL: TRUE in case of success, FALSE in case of failure.
1054
+ * @example
1055
+ * $redis->set('x', '42');
1056
+ * $redis->rename('x', 'y');
1057
+ * $redis->get('y'); // → 42
1058
+ * $redis->get('x'); // → `FALSE`
1059
+ */
1060
+ public function rename ($ srcKey , $ dstKey ) {}
913
1061
1062
+ /**
1063
+ * @see rename()
1064
+ */
1065
+ public function renameKey ($ srcKey , $ dstKey ) {}
914
1066
1067
+ /**
1068
+ * Renames a key.
1069
+ *
1070
+ * Same as rename, but will not replace a key if the destination already exists.
1071
+ * This is the same behaviour as setNx.
1072
+ *
1073
+ * @param string $srcKey
1074
+ * @param string $dstKey
1075
+ * @return BOOL: TRUE in case of success, FALSE in case of failure.
1076
+ * @example
1077
+ * $redis->set('x', '42');
1078
+ * $redis->rename('x', 'y');
1079
+ * $redis->get('y'); // → 42
1080
+ * $redis->get('x'); // → `FALSE`
1081
+ */
1082
+ public function renameNx ($ srcKey , $ dstKey ) {}
915
1083
916
1084
917
1085
918
1086
919
1087
920
1088
921
1089
922
-
923
- }
1090
+ }
0 commit comments