@@ -1066,7 +1066,7 @@ public function renameKey($srcKey, $dstKey) {}
1066
1066
1067
1067
/**
1068
1068
* Renames a key.
1069
- *
1069
+ *
1070
1070
* Same as rename, but will not replace a key if the destination already exists.
1071
1071
* This is the same behaviour as setNx.
1072
1072
*
@@ -1080,7 +1080,7 @@ public function renameKey($srcKey, $dstKey) {}
1080
1080
* $redis->get('x'); // → `FALSE`
1081
1081
*/
1082
1082
public function renameNx ($ srcKey , $ dstKey ) {}
1083
-
1083
+
1084
1084
/**
1085
1085
* Sets an expiration date (a timeout) on an item.
1086
1086
* @param string $key The key that will disappear.
@@ -1093,12 +1093,12 @@ public function renameNx($srcKey, $dstKey) {}
1093
1093
* $redis->get('x'); // will return `FALSE`, as 'x' has expired.
1094
1094
*/
1095
1095
public function setTimeout ($ key , $ ttl ) {}
1096
-
1096
+
1097
1097
/**
1098
1098
* @see setTimeout()
1099
1099
*/
1100
1100
public function expire ($ key , $ ttl ) {}
1101
-
1101
+
1102
1102
/**
1103
1103
* Sets an expiration date (a timestamp) on an item.
1104
1104
* @param strin $key The key that will disappear.
@@ -1112,7 +1112,7 @@ public function expire($key, $ttl) {}
1112
1112
* $redis->get('x'); // will return `FALSE`, as 'x' has expired.
1113
1113
*/
1114
1114
public function expireAt ($ key , $ timestamp ) {}
1115
-
1115
+
1116
1116
/**
1117
1117
* Returns the keys that match a certain pattern.
1118
1118
* @param string $pattern pattern, using '*' as a wildcard.
@@ -1122,7 +1122,7 @@ public function expireAt($key, $timestamp) {}
1122
1122
* $keyWithUserPrefix = $redis->keys('user*');
1123
1123
*/
1124
1124
public function keys ($ pattern ) {}
1125
-
1125
+
1126
1126
/**
1127
1127
* @see keys()
1128
1128
*/
@@ -1136,25 +1136,25 @@ public function getKeys($pattern) {}
1136
1136
* echo "Redis has $count keys\n";
1137
1137
*/
1138
1138
public function dbSize () {}
1139
-
1139
+
1140
1140
/**
1141
- * Authenticate the connection using a password.
1141
+ * Authenticate the connection using a password.
1142
1142
* Warning: The password is sent in plain-text over the network.
1143
1143
* @param string $password
1144
1144
* @return BOOL: TRUE if the connection is authenticated, FALSE otherwise.
1145
1145
* @example
1146
1146
* $redis->auth('foobared');
1147
1147
*/
1148
1148
public function auth ($ password ) {}
1149
-
1149
+
1150
1150
/**
1151
1151
* Starts the background rewrite of AOF (Append-Only File)
1152
1152
* @return BOOL: TRUE in case of success, FALSE in case of failure.
1153
1153
* @example
1154
1154
* $redis->bgrewriteaof();
1155
1155
*/
1156
1156
public function bgrewriteaof () {}
1157
-
1157
+
1158
1158
/**
1159
1159
* Changes the slave status
1160
1160
* Either host and port, or no parameter to stop being a slave.
@@ -1163,19 +1163,19 @@ public function bgrewriteaof() {}
1163
1163
* @return BOOL: TRUE in case of success, FALSE in case of failure.
1164
1164
* @example
1165
1165
* $redis->slaveof('10.0.1.7', 6379);
1166
- * // ...
1166
+ * // ...
1167
1167
* $redis->slaveof();
1168
1168
*/
1169
1169
public function slaveof ($ host = '' , $ port = '' ) {}
1170
-
1170
+
1171
1171
/**
1172
1172
* Describes the object pointed to by a key.
1173
- * The information to retrieve (string) and the key (string).
1173
+ * The information to retrieve (string) and the key (string).
1174
1174
* Info can be one of the following:
1175
1175
* - "encoding"
1176
1176
* - "refcount"
1177
1177
* - "idletime"
1178
- *
1178
+ *
1179
1179
* @param string $string
1180
1180
* @param string $key
1181
1181
* @return STRING for "encoding", LONG for "refcount" and "idletime", FALSE if the key doesn't exist.
@@ -1185,53 +1185,53 @@ public function slaveof($host = '', $port = '') {}
1185
1185
* $redis->object("idletime", "l"); // → 400 (in seconds, with a precision of 10 seconds).
1186
1186
*/
1187
1187
public function object ($ string = '' , $ key = '' ) {}
1188
-
1188
+
1189
1189
/**
1190
1190
* Performs a synchronous save.
1191
- * @return BOOL: TRUE in case of success, FALSE in case of failure.
1191
+ * @return BOOL: TRUE in case of success, FALSE in case of failure.
1192
1192
* If a save is already running, this command will fail and return FALSE.
1193
1193
* @example
1194
1194
* $redis->save();
1195
1195
*/
1196
1196
public function save () {}
1197
-
1197
+
1198
1198
/**
1199
1199
* Performs a background save.
1200
- * @return BOOL: TRUE in case of success, FALSE in case of failure.
1200
+ * @return BOOL: TRUE in case of success, FALSE in case of failure.
1201
1201
* If a save is already running, this command will fail and return FALSE.
1202
1202
* @example
1203
1203
* $redis->bgSave();
1204
1204
*/
1205
1205
public function bgsave () {}
1206
-
1206
+
1207
1207
/**
1208
1208
* Returns the timestamp of the last disk save.
1209
1209
* @return INT: timestamp.
1210
1210
* @example
1211
1211
* $redis->lastSave();
1212
1212
*/
1213
1213
public function lastSave () {}
1214
-
1215
-
1214
+
1215
+
1216
1216
/**
1217
1217
* Returns the type of data pointed by a given key.
1218
1218
* @param string $key
1219
- * @return Depending on the type of the data pointed by the key,
1219
+ * @return Depending on the type of the data pointed by the key,
1220
1220
* this method will return the following value:
1221
1221
* - string: Redis::REDIS_STRING
1222
1222
* - set: Redis::REDIS_SET
1223
1223
* - list: Redis::REDIS_LIST
1224
1224
* - zset: Redis::REDIS_ZSET
1225
1225
* - hash: Redis::REDIS_HASH
1226
- * - other: Redis::REDIS_NOT_FOUND
1226
+ * - other: Redis::REDIS_NOT_FOUND
1227
1227
* @example
1228
1228
* $redis->type('key');
1229
1229
*/
1230
1230
public function type ($ key ) {}
1231
-
1231
+
1232
1232
/**
1233
1233
* Append specified string to the string stored in specified key.
1234
- * @param string $key
1234
+ * @param string $key
1235
1235
* @param string $value
1236
1236
* @return INTEGER: Size of the value after the append
1237
1237
* @example
@@ -1242,6 +1242,159 @@ public function type($key) {}
1242
1242
public function append () {}
1243
1243
1244
1244
1245
+ /**
1246
+ * Return a substring of a larger string
1247
+ * @param string $key
1248
+ * @param int $start
1249
+ * @param int $end
1250
+ * @return STRING: the substring
1251
+ * @example
1252
+ * $redis->set('key', 'string value');
1253
+ * $redis->getRange('key', 0, 5); // 'string'
1254
+ * $redis->getRange('key', -5, -1); // 'value'
1255
+ */
1256
+ public function getRange ($ key , $ start , $ end ) {}
1257
+
1258
+ /**
1259
+ * Return a substring of a larger string
1260
+ * @deprecated
1261
+ * @param type $key
1262
+ * @param type $start
1263
+ * @param type $end
1264
+ */
1265
+ public function substr ($ key , $ start , $ end ) {}
1266
+
1267
+
1268
+ /**
1269
+ * Changes a substring of a larger string.
1270
+ * @param string $key
1271
+ * @param int $offset
1272
+ * @param string $value
1273
+ * @return STRING: the length of the string after it was modified.
1274
+ * @example
1275
+ * $redis->set('key', 'Hello world');
1276
+ * $redis->setRange('key', 6, "redis"); // returns 11
1277
+ * $redis->get('key'); // "Hello redis"
1278
+ */
1279
+ public function setRange ($ key , $ offset , $ value ) {}
1280
+
1281
+ /**
1282
+ * Get the length of a string value.
1283
+ * @param type $key
1284
+ * @return INTEGER
1285
+ * @example
1286
+ * $redis->set('key', 'value');
1287
+ * $redis->strlen('key'); // 5
1288
+ */
1289
+ public function strlen ($ key ) {}
1290
+
1291
+ /**
1292
+ * Return a single bit out of a larger string
1293
+ * @param string $key
1294
+ * @param int $offset
1295
+ * @return LONG: the bit value (0 or 1)
1296
+ * @example
1297
+ * $redis->set('key', "\x7f"); // this is 0111 1111
1298
+ * $redis->getBit('key', 0); // 0
1299
+ * $redis->getBit('key', 1); // 1
1300
+ */
1301
+ public function getBit ($ key , $ offset ) {}
1302
+
1303
+ /**
1304
+ * Changes a single bit of a string.
1305
+ * @param string $key
1306
+ * @param int $offset
1307
+ * @param bool||int $value bool or int (1 or 0)
1308
+ * @return LONG: 0 or 1, the value of the bit before it was set.
1309
+ * @example
1310
+ * $redis->set('key', "*"); // ord("*") = 42 = 0x2f = "0010 1010"
1311
+ * $redis->setBit('key', 5, 1); // returns 0
1312
+ * $redis->setBit('key', 7, 1); // returns 0
1313
+ * $redis->get('key'); // chr(0x2f) = "/" = b("0010 1111")
1314
+ */
1315
+ public function setBit ($ key , $ offset , $ value ) {}
1316
+
1317
+
1318
+ /**
1319
+ * Removes all entries from the current database.
1320
+ * @return BOOL: Always TRUE.
1321
+ * @example $redis->flushDB();
1322
+ */
1323
+ public function flushDB () {}
1324
+
1325
+ /**
1326
+ * Removes all entries from all databases.
1327
+ * @return BOOL: Always TRUE.
1328
+ * @example $redis->flushAll();
1329
+ */
1330
+ public function flushAll () {}
1331
+
1332
+
1333
+
1334
+ /**
1335
+ * Sort
1336
+ * @param string $key
1337
+ * @param array $option array(key => value, ...) - optional, with the following keys and values:
1338
+ * - 'by' => 'some_pattern_*',
1339
+ * - 'limit' => array(0, 1),
1340
+ * - 'get' => 'some_other_pattern_*' or an array of patterns,
1341
+ * - 'sort' => 'asc' or 'desc',
1342
+ * - 'alpha' => TRUE,
1343
+ * - 'store' => 'external-key'
1344
+ * @return
1345
+ * An array of values, or a number corresponding to the number of elements stored if that was used.
1346
+ * @example
1347
+ * $redis->delete('s');
1348
+ * $redis->sadd('s', 5);
1349
+ * $redis->sadd('s', 4);
1350
+ * $redis->sadd('s', 2);
1351
+ * $redis->sadd('s', 1);
1352
+ * $redis->sadd('s', 3);
1353
+ *
1354
+ * var_dump($redis->sort('s')); // 1,2,3,4,5
1355
+ * var_dump($redis->sort('s', array('sort' => 'desc'))); // 5,4,3,2,1
1356
+ * var_dump($redis->sort('s', array('sort' => 'desc', 'store' => 'out'))); // (int)5
1357
+ */
1358
+ public function sort ($ key , $ option = null ) {}
1359
+
1360
+
1361
+ /**
1362
+ * Returns an associative array of strings and integers, with the following keys:
1363
+ * - redis_version
1364
+ * - arch_bits
1365
+ * - uptime_in_seconds
1366
+ * - uptime_in_days
1367
+ * - connected_clients
1368
+ * - connected_slaves
1369
+ * - used_memory
1370
+ * - changes_since_last_save
1371
+ * - bgsave_in_progress
1372
+ * - last_save_time
1373
+ * - total_connections_received
1374
+ * - total_commands_processed
1375
+ * - role
1376
+ * @example $redis->info();
1377
+ */
1378
+ public function info () {}
1379
+
1380
+ /**
1381
+ * Returns the time to live left for a given key, in seconds. If the key doesn't exist, FALSE is returned.
1382
+ * @param string $key
1383
+ * @return Long, the time left to live in seconds.
1384
+ * @example $redis->ttl('key');
1385
+ */
1386
+ public function ttl ($ key ) {}
1387
+
1388
+ /**
1389
+ * Remove the expiration timer from a key.
1390
+ * @param string $key
1391
+ * @return BOOL: TRUE if a timeout was removed, FALSE if the key didn’t exist or didn’t have an expiration timer.
1392
+ * @example $redis->persist('key');
1393
+ */
1394
+ public function persist ($ key ) {}
1395
+
1396
+
1397
+
1245
1398
1246
1399
1247
1400
0 commit comments