Skip to content

Commit a5473d8

Browse files
author
Max Kamashev
committed
add few command
1 parent c32a1e0 commit a5473d8

File tree

1 file changed

+159
-1
lines changed

1 file changed

+159
-1
lines changed

redisphp.php

Lines changed: 159 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1080,8 +1080,166 @@ public function renameKey($srcKey, $dstKey) {}
10801080
* $redis->get('x'); // → `FALSE`
10811081
*/
10821082
public function renameNx($srcKey, $dstKey) {}
1083+
1084+
/**
1085+
* Sets an expiration date (a timeout) on an item.
1086+
* @param string $key The key that will disappear.
1087+
* @param int $ttl The key's remaining Time To Live, in seconds.
1088+
* @return bool: TRUE in case of success, FALSE in case of failure.
1089+
* @example
1090+
* $redis->set('x', '42');
1091+
* $redis->setTimeout('x', 3); // x will disappear in 3 seconds.
1092+
* sleep(5); // wait 5 seconds
1093+
* $redis->get('x'); // will return `FALSE`, as 'x' has expired.
1094+
*/
1095+
public function setTimeout($key, $ttl) {}
1096+
1097+
/**
1098+
* @see setTimeout()
1099+
*/
1100+
public function expire($key, $ttl) {}
1101+
1102+
/**
1103+
* Sets an expiration date (a timestamp) on an item.
1104+
* @param strin $key The key that will disappear.
1105+
* @param integer $timestamp Unix timestamp. The key's date of death, in seconds from Epoch time.
1106+
* @return bool: TRUE in case of success, FALSE in case of failure.
1107+
* @example
1108+
* $redis->set('x', '42');
1109+
* $now = time(NULL); // current timestamp
1110+
* $redis->expireAt('x', $now + 3); // x will disappear in 3 seconds.
1111+
* sleep(5); // wait 5 seconds
1112+
* $redis->get('x'); // will return `FALSE`, as 'x' has expired.
1113+
*/
1114+
public function expireAt($key, $timestamp) {}
1115+
1116+
/**
1117+
* Returns the keys that match a certain pattern.
1118+
* @param string $pattern pattern, using '*' as a wildcard.
1119+
* @return Array of STRING: The keys that match a certain pattern.
1120+
* @example
1121+
* $allKeys = $redis->keys('*'); // all keys will match this.
1122+
* $keyWithUserPrefix = $redis->keys('user*');
1123+
*/
1124+
public function keys($pattern) {}
1125+
1126+
/**
1127+
* @see keys()
1128+
*/
1129+
public function getKeys($pattern) {}
10831130

1084-
1131+
/**
1132+
* Returns the current database's size.
1133+
* @return INTEGER: DB size, in number of keys.
1134+
* @example
1135+
* $count = $redis->dbSize();
1136+
* echo "Redis has $count keys\n";
1137+
*/
1138+
public function dbSize() {}
1139+
1140+
/**
1141+
* Authenticate the connection using a password.
1142+
* Warning: The password is sent in plain-text over the network.
1143+
* @param string $password
1144+
* @return BOOL: TRUE if the connection is authenticated, FALSE otherwise.
1145+
* @example
1146+
* $redis->auth('foobared');
1147+
*/
1148+
public function auth($password) {}
1149+
1150+
/**
1151+
* Starts the background rewrite of AOF (Append-Only File)
1152+
* @return BOOL: TRUE in case of success, FALSE in case of failure.
1153+
* @example
1154+
* $redis->bgrewriteaof();
1155+
*/
1156+
public function bgrewriteaof() {}
1157+
1158+
/**
1159+
* Changes the slave status
1160+
* Either host and port, or no parameter to stop being a slave.
1161+
* @param string $host [optional]
1162+
* @param int $port [optional]
1163+
* @return BOOL: TRUE in case of success, FALSE in case of failure.
1164+
* @example
1165+
* $redis->slaveof('10.0.1.7', 6379);
1166+
* // ...
1167+
* $redis->slaveof();
1168+
*/
1169+
public function slaveof($host = '', $port = '') {}
1170+
1171+
/**
1172+
* Describes the object pointed to by a key.
1173+
* The information to retrieve (string) and the key (string).
1174+
* Info can be one of the following:
1175+
* - "encoding"
1176+
* - "refcount"
1177+
* - "idletime"
1178+
*
1179+
* @param string $key
1180+
* @param string $value
1181+
* @return STRING for "encoding", LONG for "refcount" and "idletime", FALSE if the key doesn't exist.
1182+
* @example
1183+
* $redis->object("encoding", "l"); // → ziplist
1184+
* $redis->object("refcount", "l"); // → 1
1185+
* $redis->object("idletime", "l"); // → 400 (in seconds, with a precision of 10 seconds).
1186+
*/
1187+
public function object($key = '', $value = '') {}
1188+
1189+
/**
1190+
* Performs a synchronous save.
1191+
* @return BOOL: TRUE in case of success, FALSE in case of failure.
1192+
* If a save is already running, this command will fail and return FALSE.
1193+
* @example
1194+
* $redis->save();
1195+
*/
1196+
public function save() {}
1197+
1198+
/**
1199+
* Performs a background save.
1200+
* @return BOOL: TRUE in case of success, FALSE in case of failure.
1201+
* If a save is already running, this command will fail and return FALSE.
1202+
* @example
1203+
* $redis->bgSave();
1204+
*/
1205+
public function bgsave() {}
1206+
1207+
/**
1208+
* Returns the timestamp of the last disk save.
1209+
* @return INT: timestamp.
1210+
* @example
1211+
* $redis->lastSave();
1212+
*/
1213+
public function lastSave() {}
1214+
1215+
1216+
/**
1217+
* Returns the type of data pointed by a given key.
1218+
* @param string $key
1219+
* @return Depending on the type of the data pointed by the key,
1220+
* this method will return the following value:
1221+
* - string: Redis::REDIS_STRING
1222+
* - set: Redis::REDIS_SET
1223+
* - list: Redis::REDIS_LIST
1224+
* - zset: Redis::REDIS_ZSET
1225+
* - hash: Redis::REDIS_HASH
1226+
* - other: Redis::REDIS_NOT_FOUND
1227+
* @example
1228+
* $redis->type('key');
1229+
*/
1230+
public function type() {}
1231+
1232+
/**
1233+
* Append specified string to the string stored in specified key.
1234+
* @param string $key
1235+
* @param string $value
1236+
* @return INTEGER: Size of the value after the append
1237+
* @example
1238+
* $redis->set('key', 'value1');
1239+
* $redis->append('key', 'value2'); // 12
1240+
* $redis->get('key'); // 'value1value2'
1241+
*/
1242+
public function append() {}
10851243

10861244

10871245

0 commit comments

Comments
 (0)