3
3
* Helper autocomplete for php redis extension
4
4
* @author Max Kamashev <[email protected] >
5
5
* @link https://github.com/ukko/phpredis-phpdoc
6
+ *
7
+ * @method echo string $string Sends a string to Redis, which replies with the same string
6
8
*/
7
9
class Redis
8
10
{
@@ -131,7 +133,7 @@ public function setOption( $name, $value ) {}
131
133
* Get client option
132
134
*
133
135
* @param string $name parameter name
134
- * @return Parameter value.
136
+ * @return int Parameter value.
135
137
* @example
136
138
* // return Redis::SERIALIZER_NONE, Redis::SERIALIZER_PHP, or Redis::SERIALIZER_IGBINARY.
137
139
* $redis->getOption(Redis::OPT_SERIALIZER);
@@ -146,7 +148,6 @@ public function getOption( $name ) {}
146
148
*/
147
149
public function ping ( ) {}
148
150
149
-
150
151
/**
151
152
* Get the value related to the specified key
152
153
*
@@ -817,7 +818,7 @@ public function lRemove( $key, $value, $count ) {}
817
818
* @param int $position Redis::BEFORE | Redis::AFTER
818
819
* @param string $pivot
819
820
* @param string $value
820
- * @return The number of the elements in the list, -1 if the pivot didn't exists.
821
+ * @return int The number of the elements in the list, -1 if the pivot didn't exists.
821
822
* @link http://redis.io/commands/linsert
822
823
* @example
823
824
* <pre>
@@ -1371,6 +1372,23 @@ public function renameNx( $srcKey, $dstKey ) {}
1371
1372
*/
1372
1373
public function expire ( $ key , $ ttl ) {}
1373
1374
1375
+ /**
1376
+ * Sets an expiration date (a timeout in milliseconds) on an item.
1377
+ *
1378
+ * @param string $key The key that will disappear.
1379
+ * @param int $pttl The key's remaining Time To Live, in milliseconds.
1380
+ * @return bool: TRUE in case of success, FALSE in case of failure.
1381
+ * @link http://redis.io/commands/pexpire
1382
+ * @example
1383
+ * <pre>
1384
+ * $redis->set('x', '42');
1385
+ * $redis->pExpire('x', 11500); // x will disappear in 11500 milliseconds.
1386
+ * $redis->ttl('x'); // 12
1387
+ * $redis->pttl('x'); // 11500
1388
+ * </pre>
1389
+ */
1390
+ public function pExpire ( $ key , $ ttl ) {}
1391
+
1374
1392
/**
1375
1393
* @see expire()
1376
1394
* @param string $key
@@ -1397,6 +1415,23 @@ public function setTimeout( $key, $ttl ) {}
1397
1415
*/
1398
1416
public function expireAt ( $ key , $ timestamp ) {}
1399
1417
1418
+ /**
1419
+ * Sets an expiration date (a timestamp) on an item. Requires a timestamp in milliseconds
1420
+ *
1421
+ * @param string $key The key that will disappear.
1422
+ * @param int $timestamp Unix timestamp. The key's date of death, in seconds from Epoch time.
1423
+ * @return bool: TRUE in case of success, FALSE in case of failure.
1424
+ * @link http://redis.io/commands/pexpireat
1425
+ * @example
1426
+ * <pre>
1427
+ * $redis->set('x', '42');
1428
+ * $redis->pExpireAt('x', 1555555555005);
1429
+ * echo $redis->ttl('x'); // 218270121
1430
+ * echo $redis->pttl('x'); // 218270120575
1431
+ * </pre>
1432
+ */
1433
+ public function pExpireAt ( $ key , $ timestamp ) {}
1434
+
1400
1435
/**
1401
1436
* Returns the keys that match a certain pattern.
1402
1437
*
@@ -1523,7 +1558,9 @@ public function lastSave( ) {}
1523
1558
* Returns the type of data pointed by a given key.
1524
1559
*
1525
1560
* @param string $key
1526
- * @return Depending on the type of the data pointed by the key,
1561
+ * @return int
1562
+ *
1563
+ * Depending on the type of the data pointed by the key,
1527
1564
* this method will return the following value:
1528
1565
* - string: Redis::REDIS_STRING
1529
1566
* - set: Redis::REDIS_SET
@@ -1771,6 +1808,18 @@ public function resetStat( ) {}
1771
1808
*/
1772
1809
public function ttl ( $ key ) {}
1773
1810
1811
+ /**
1812
+ * Returns a time to live left for a given key, in milliseconds.
1813
+ *
1814
+ * If the key doesn't exist, FALSE is returned.
1815
+ *
1816
+ * @param string $key
1817
+ * @return int the time left to live in milliseconds.
1818
+ * @link http://redis.io/commands/pttl
1819
+ * @example $redis->pttl('key');
1820
+ */
1821
+ public function pttl ( $ key ) {}
1822
+
1774
1823
/**
1775
1824
* Remove the expiration timer from a key.
1776
1825
*
0 commit comments