@@ -421,6 +421,24 @@ $redis->incr('key1'); /* 4 */
421
421
$redis->incrBy('key1', 10); /* 14 */
422
422
</pre >
423
423
424
+ ## incrByFloat
425
+ ##### Description
426
+ Increment the key with floating point precision.
427
+ ##### Parameters
428
+ * key*
429
+ * value* : (float) value that will be added to the key
430
+ ##### Return value
431
+ * FLOAT* the new value
432
+ ##### Examples
433
+ <pre >
434
+ $redis->incrByFloat('key1', 1.5); /* key1 didn't exist, so it will now be 1.5 */
435
+
436
+
437
+ $redis->incrByFloat('key1', 1.5); /* 3 */
438
+ $redis->incrByFloat('key1', -1.5); /* 1.5 */
439
+ $redis->incrByFloat('key1', 2.5); /* 3.5 */
440
+ </pre >
441
+
424
442
## decr, decrBy
425
443
##### Description
426
444
Decrement the number stored at key by one. If the second argument is filled, it will be used as the integer value of the decrement.
@@ -1626,7 +1644,9 @@ var_dump($redis->sort('s', array('sort' => 'desc', 'store' => 'out'))); // (int)
1626
1644
1627
1645
## info
1628
1646
##### * Description*
1629
- Returns an associative array of strings and integers, with the following keys:
1647
+ Returns an associative array from REDIS that provides information about the server. Passing
1648
+ no arguments to INFO will call the standard REDIS INFO command, which returns information such
1649
+ as the following:
1630
1650
1631
1651
* redis_version
1632
1652
* arch_bits
@@ -1642,13 +1662,17 @@ Returns an associative array of strings and integers, with the following keys:
1642
1662
* total_commands_processed
1643
1663
* role
1644
1664
1665
+ You can pass a variety of options to INFO (per the Redis documentation), which will modify what is
1666
+ returned.
1645
1667
1646
1668
##### * Parameters*
1647
- None.
1669
+ * option * : The option to provide redis (e.g. "COMMANDSTATS", "CPU")
1648
1670
1649
1671
##### * Example*
1650
1672
<pre >
1651
- $redis->info();
1673
+ $redis->info(); /* standard redis INFO command */
1674
+ $redis->info("COMMANDSTATS"); /* Statistical information on the commands that have been run (>=2.6 only)
1675
+ $redis->info("CPU"); /* just CPU information from Redis INFO */
1652
1676
</pre >
1653
1677
1654
1678
## resetStat
@@ -2301,6 +2325,23 @@ $redis->hIncrBy('h', 'x', 2); /* returns 2: h[x] = 2 now. */
2301
2325
$redis->hIncrBy('h', 'x', 1); /* h[x] ← 2 + 1. Returns 3 */
2302
2326
</pre >
2303
2327
2328
+ ## hIncrByFloat
2329
+ ##### Description
2330
+ Increments the value of a hash member by the provided float value
2331
+ ##### Parameters
2332
+ * key*
2333
+ * member*
2334
+ * value* : (float) value that will be added to the member's value
2335
+ ##### Return value
2336
+ * FLOAT* the new value
2337
+ ##### Examples
2338
+ <pre >
2339
+ $redis->delete('h');
2340
+ $redis->hIncrByFloat('h','x', 1.5); /* returns 1.5: h[x] = 1.5 now */
2341
+ $redis->hIncrByFLoat('h', 'x', 1.5); /* returns 3.0: h[x] = 3.0 now */
2342
+ $redis->hIncrByFloat('h', 'x', -3.0); /* returns 0.0: h[x] = 0.0 now */
2343
+ </pre >
2344
+
2304
2345
## hMset
2305
2346
##### Description
2306
2347
Fills in a whole hash. Non-string values are converted to string, using the standard ` (string) ` cast. NULL values are stored as empty strings.
0 commit comments