@@ -1393,9 +1393,182 @@ public function ttl($key) {}
1393
1393
*/
1394
1394
public function persist ($ key ) {}
1395
1395
1396
+ /**
1397
+ * Sets multiple key-value pairs in one atomic command.
1398
+ * MSETNX only returns TRUE if all the keys were set (see SETNX).
1399
+ * @param array(key => value) $array Pairs: array(key => value, ...)
1400
+ * @return Bool TRUE in case of success, FALSE in case of failure.
1401
+ * @example
1402
+ * $redis->mset(array('key0' => 'value0', 'key1' => 'value1'));
1403
+ * var_dump($redis->get('key0'));
1404
+ * var_dump($redis->get('key1'));
1405
+ * // Output:
1406
+ * // string(6) "value0"
1407
+ * // string(6) "value1"
1408
+ */
1409
+ public function mset ($ array ) {}
1396
1410
1411
+ /**
1412
+ * @see mset()
1413
+ */
1414
+ public function msetnx ($ array ) {}
1397
1415
1416
+ /**
1417
+ * Pops a value from the tail of a list, and pushes it to the front of another list.
1418
+ * Also return this value.
1419
+ * @since redis >= 1.1
1420
+ * @param string $srcKey
1421
+ * @param string $dstKey
1422
+ * @return STRING The element that was moved in case of success, FALSE in case of failure.
1423
+ * @example
1424
+ * $redis->delete('x', 'y');
1425
+ *
1426
+ * $redis->lPush('x', 'abc');
1427
+ * $redis->lPush('x', 'def');
1428
+ * $redis->lPush('y', '123');
1429
+ * $redis->lPush('y', '456');
1430
+ *
1431
+ * // move the last of x to the front of y.
1432
+ * var_dump($redis->rpoplpush('x', 'y'));
1433
+ * var_dump($redis->lRange('x', 0, -1));
1434
+ * var_dump($redis->lRange('y', 0, -1));
1435
+ *
1436
+ * //Output:
1437
+ * //
1438
+ * //string(3) "abc"
1439
+ * //array(1) {
1440
+ * // [0]=>
1441
+ * // string(3) "def"
1442
+ * //}
1443
+ * //array(3) {
1444
+ * // [0]=>
1445
+ * // string(3) "abc"
1446
+ * // [1]=>
1447
+ * // string(3) "456"
1448
+ * // [2]=>
1449
+ * // string(3) "123"
1450
+ * //}
1451
+ */
1452
+ public function rpoplpush ($ srcKey , $ dstKey ) {}
1453
+
1454
+ /**
1455
+ * A blocking version of rpoplpush, with an integral timeout in the third parameter.
1456
+ * @param string $srcKey
1457
+ * @param string $dstKey
1458
+ * @param long $timeout
1459
+ * @return STRING The element that was moved in case of success, FALSE in case of timeout.
1460
+ */
1461
+ public function brpoplpush ($ srcKey , $ dstKey , $ timeout ) {}
1398
1462
1463
+ /**
1464
+ * Adds the specified member with a given score to the sorted set stored at key.
1465
+ * @param string $key
1466
+ * @param double $score
1467
+ * @param string $value
1468
+ * @return Long 1 if the element is added. 0 otherwise.
1469
+ * @example
1470
+ * $redis->zAdd('key', 1, 'val1');
1471
+ * $redis->zAdd('key', 0, 'val0');
1472
+ * $redis->zAdd('key', 5, 'val5');
1473
+ * $redis->zRange('key', 0, -1); // array(val0, val1, val5)
1474
+ */
1475
+ public function zAdd ($ key , $ score , $ value ) {}
1476
+
1477
+ /**
1478
+ * Returns a range of elements from the ordered set stored at the specified key,
1479
+ * with values in the range [start, end]. start and stop are interpreted as zero-based indices:
1480
+ * 0 the first element,
1481
+ * 1 the second ...
1482
+ * -1 the last element,
1483
+ * -2 the penultimate ...
1484
+ * @param string $key
1485
+ * @param long $start
1486
+ * @param long $end
1487
+ * @param bool $withscores
1488
+ * @return Array containing the values in specified range.
1489
+ * @example
1490
+ * $redis->zAdd('key1', 0, 'val0');
1491
+ * $redis->zAdd('key1', 2, 'val2');
1492
+ * $redis->zAdd('key1', 10, 'val10');
1493
+ * $redis->zRange('key1', 0, -1); // array('val0', 'val2', 'val10')
1494
+ * // with scores
1495
+ * $redis->zRange('key1', 0, -1, true); // array('val0' => 0, 'val2' => 2, 'val10' => 10)
1496
+ */
1497
+ public function zRange ($ key , $ start , $ end , $ withscores = false ) {}
1498
+
1499
+ /**
1500
+ * Deletes a specified member from the ordered set.
1501
+ * @param string $key
1502
+ * @param string $member
1503
+ * @return LONG 1 on success, 0 on failure.
1504
+ * @example
1505
+ * $redis->zAdd('key', 0, 'val0');
1506
+ * $redis->zAdd('key', 2, 'val2');
1507
+ * $redis->zAdd('key', 10, 'val10');
1508
+ * $redis->zDelete('key', 'val2');
1509
+ * $redis->zRange('key', 0, -1); // array('val0', 'val10')
1510
+ */
1511
+ public function zDelete ($ key , $ member ) {}
1512
+
1513
+ /**
1514
+ * @see zDelete()
1515
+ */
1516
+ public function zRem ($ key , $ member ) {}
1517
+
1518
+ /**
1519
+ * Returns the elements of the sorted set stored at the specified key in the range [start, end]
1520
+ * in reverse order. start and stop are interpretated as zero-based indices:
1521
+ * 0 the first element,
1522
+ * 1 the second ...
1523
+ * -1 the last element,
1524
+ * -2 the penultimate ...
1525
+ * @param string $key
1526
+ * @param long $start
1527
+ * @param long $end
1528
+ * @param bool $withscore
1529
+ * @return Array containing the values in specified range.
1530
+ * @example
1531
+ * $redis->zAdd('key', 0, 'val0');
1532
+ * $redis->zAdd('key', 2, 'val2');
1533
+ * $redis->zAdd('key', 10, 'val10');
1534
+ * $redis->zRevRange('key', 0, -1); // array('val10', 'val2', 'val0')
1535
+ *
1536
+ * // with scores
1537
+ * $redis->zRevRange('key', 0, -1, true); // array('val10' => 10, 'val2' => 2, 'val0' => 0)
1538
+ */
1539
+ public function zRevRange ($ key , $ start , $ end , $ withscore = false ) {}
1540
+
1541
+ /**
1542
+ * Returns the elements of the sorted set stored at the specified key which have scores in the
1543
+ * range [start,end]. Adding a parenthesis before start or end excludes it from the range.
1544
+ * +inf and -inf are also valid limits.
1545
+ *
1546
+ * zRevRangeByScore returns the same items in reverse order, when the start and end parameters are swapped.
1547
+ * @param string $key
1548
+ * @param long $start
1549
+ * @param long $end
1550
+ * @param array $options Two options are available: withscores => TRUE, and limit => array($offset, $count)
1551
+ * @return Array containing the values in specified range.
1552
+ * @example
1553
+ * $redis->zAdd('key', 0, 'val0');
1554
+ * $redis->zAdd('key', 2, 'val2');
1555
+ * $redis->zAdd('key', 10, 'val10');
1556
+ * $redis->zRangeByScore('key', 0, 3); // array('val0', 'val2')
1557
+ * $redis->zRangeByScore('key', 0, 3, array('withscores' => TRUE); // array('val0' => 0, 'val2' => 2)
1558
+ * $redis->zRangeByScore('key', 0, 3, array('limit' => array(1, 1)); // array('val2' => 2)
1559
+ * $redis->zRangeByScore('key', 0, 3, array('limit' => array(1, 1)); // array('val2')
1560
+ * $redis->zRangeByScore('key', 0, 3, array('withscores' => TRUE, 'limit' => array(1, 1)); // array('val2' => 2)
1561
+ */
1562
+ public function zRangeByScore ($ key , $ start , $ end , array $ options ) {}
1563
+
1564
+ /**
1565
+ * @see zRangeByScore()
1566
+ * @param type $key
1567
+ * @param type $start
1568
+ * @param type $end
1569
+ * @param array $options
1570
+ */
1571
+ public function zRevRangeByScore ($ key , $ start , $ end , array $ options ) {}
1399
1572
1400
1573
1401
1574
}
0 commit comments