Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpredis/phpredis.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Favre-Felix <n.favrefelix@gmail.com>2010-09-16 17:50:31 +0400
committerNicolas Favre-Felix <n.favrefelix@gmail.com>2010-09-16 17:50:31 +0400
commit6769e21cce3a3f69d63bc8a6a6c074a175a9f443 (patch)
tree2ab916fbe63c01acf08098a039005dac79f5b3e7 /README.markdown
parentc18fb241cb8adc5a4507c31fab0f034ce6b80f06 (diff)
Added documentation for sort.
Diffstat (limited to 'README.markdown')
-rw-r--r--README.markdown30
1 files changed, 29 insertions, 1 deletions
diff --git a/README.markdown b/README.markdown
index 6b2fa358..0aa273b5 100644
--- a/README.markdown
+++ b/README.markdown
@@ -1103,7 +1103,35 @@ $redis->flushAll();
</pre>
## sort
-Documentation for this method will be added shortly.
+##### *Description*
+##### *Parameters*
+*Key*: key
+*Options*: array(key => value, ...) - optional, with the following keys and values:
+<pre>
+ 'by' => 'some_pattern_*',
+ 'limit' => array(0, 1),
+ 'get' => 'some_other_pattern_*',
+ 'sort' => 'asc' or 'desc',
+ 'alpha' => TRUE,
+ 'store' => 'external-key'
+</pre>
+##### *Return value*
+An array of values, or a number corresponding to the number of elements stored if that was used.
+
+##### *Example*
+<pre>
+$redis->delete('s');
+$redis->sadd('s', 5);
+$redis->sadd('s', 4);
+$redis->sadd('s', 2);
+$redis->sadd('s', 1);
+$redis->sadd('s', 3);
+
+var_dump($redis->sort('s')); // 1,2,3,4,5
+var_dump($redis->sort('s', array('sort' => 'desc'))); // 5,4,3,2,1
+var_dump($redis->sort('s', array('sort' => 'desc', 'store' => 'out'))); // (int)5
+</pre>
+
## info
##### *Description*