@@ -1703,6 +1703,44 @@ public function getBit( $key, $offset ) {}
1703
1703
*/
1704
1704
public function setBit ( $ key , $ offset , $ value ) {}
1705
1705
1706
+ /**
1707
+ * Count bits in a string.
1708
+ *
1709
+ * @param string $key
1710
+ * @return int The number of bits set to 1 in the value behind the input key.
1711
+ * @link http://redis.io/commands/bitcount
1712
+ * @example
1713
+ * <pre>
1714
+ * $redis->set('bit', '345'); // // 11 0011 0011 0100 0011 0101
1715
+ * var_dump( $redis->bitCount('bit', 0, 0) ); // int(4)
1716
+ * var_dump( $redis->bitCount('bit', 1, 1) ); // int(3)
1717
+ * var_dump( $redis->bitCount('bit', 2, 2) ); // int(4)
1718
+ * var_dump( $redis->bitCount('bit', 0, 2) ); // int(11)
1719
+ * </pre>
1720
+ */
1721
+ public function bitCount ( $ key ) {}
1722
+
1723
+ /**
1724
+ * Bitwise operation on multiple keys.
1725
+ *
1726
+ * @param string $operation either "AND", "OR", "NOT", "XOR"
1727
+ * @param string $retKey return key
1728
+ * @param string $key1
1729
+ * @param string $key2
1730
+ * @return int The size of the string stored in the destination key.
1731
+ * @link http://redis.io/commands/bitop
1732
+ * @example
1733
+ * <pre>
1734
+ * $redis->set('bit1', '1'); // 11 0001
1735
+ * $redis->set('bit2', '2'); // 11 0010
1736
+ *
1737
+ * $redis->bitOp('AND', 'bit', 'bit1', 'bit2'); // bit = 110000
1738
+ * $redis->bitOp('OR', 'bit', 'bit1', 'bit2'); // bit = 110011
1739
+ * $redis->bitOp('NOT', 'bit', 'bit1', 'bit2'); // bit = 110011
1740
+ * $redis->bitOp('XOR', 'bit', 'bit1', 'bit2'); // bit = 11
1741
+ * </pre>
1742
+ */
1743
+ public function bitOp ( $ operation , $ retKey , $ key1 , $ key2 , $ key3 = null ) {}
1706
1744
1707
1745
/**
1708
1746
* Removes all entries from the current database.
@@ -1802,7 +1840,15 @@ public function sort( $key, $option = null ) {}
1802
1840
* - vm_enabled
1803
1841
* - role
1804
1842
* @link http://redis.io/commands/info
1805
- * @example $redis->info();
1843
+ * @example
1844
+ * <pre>
1845
+ * $redis->info();
1846
+ *
1847
+ * or
1848
+ *
1849
+ * $redis->info("COMMANDSTATS"); //Information on the commands that have been run (>=2.6 only)
1850
+ * $redis->info("CPU"); // just CPU information from Redis INFO
1851
+ * </pre>
1806
1852
*/
1807
1853
public function info ( $ option = null ) {}
1808
1854
@@ -2112,7 +2158,7 @@ public function zRangeByScore( $key, $start, $end, array $options = array() ) {}
2112
2158
* @param int $start
2113
2159
* @param int $end
2114
2160
* @param array $options
2115
- *
2161
+ *
2116
2162
* @return array
2117
2163
*/
2118
2164
public function zRevRangeByScore ( $ key , $ start , $ end , array $ options = array () ) {}
0 commit comments