diff options
author | Nicolas Favre-Felix <n.favre-felix@owlient.eu> | 2009-11-24 14:34:23 +0300 |
---|---|---|
committer | Nicolas Favre-Felix <n.favre-felix@owlient.eu> | 2009-11-24 14:34:23 +0300 |
commit | 2295baf19cae73fec4ae192acfdac4d966ef0807 (patch) | |
tree | a08b691e2d3070f76bbfbac20424f860e753a4a8 /README.markdown | |
parent | 6f9533fa41bfeee5bb46930b3fc811ed3e8f83ae (diff) | |
parent | 05f9666da747d538fe2d523ce941cf6ccc8a2df5 (diff) |
Merge branch 'master' of git@github.com:owlient/phpredis
Diffstat (limited to 'README.markdown')
-rw-r--r-- | README.markdown | 43 |
1 files changed, 27 insertions, 16 deletions
diff --git a/README.markdown b/README.markdown index 5f4c6342..46d1ad38 100644 --- a/README.markdown +++ b/README.markdown @@ -101,7 +101,7 @@ $redis->delete('key1', 'key2', 'key3'); /* return 0 */ ##### Description Verify if the specified key exists. ##### Parameters -*key*: key +*key* ##### Return value *BOOL*: If the key exists, return TRUE, else return FALSE. ##### Examples @@ -115,7 +115,7 @@ $this->exists('NonExistingKey'); /* FALSE*/ ##### Description Increment the number stored at key by one. If the second argument is filled, it will be used as the integer value of the increment. ##### Parameters -*key*: key +*key* *value*: value that will be incremented to key ##### Return value *INT* the new value of incremented value @@ -133,7 +133,7 @@ $redis->incr('key1'); /* 4 */ ##### Description Decremetn the number stored at key by one. If the second argument is filled, it will be used as the integer value of the decrement. ##### Parameters -*key*: key +*key* *value*: value that will be decremented to key ##### Return value *INT* the new value of decremented value @@ -166,8 +166,8 @@ $redis->getMultiple(array('key0', 'key1', 'key5')); /* array(FALSE, 'value2', FA ##### Description Add the string value to the head(right) of the list. Create the list if the key didn't exist. Il the key exists and is not a list, FALSE is returned. ##### Parameters -*key* string -*value* string +*key* +*value* String, value to push in key ##### Return value *BOOL* ##### Examples @@ -181,8 +181,8 @@ $redis->rpush('key1', 'C'); /* key1 => [ 'A', 'B', 'C' ] */ ##### Description Add the string value to the tail(left) of the list. Create the list if the key didn't exist. Il the key exists and is not a list, FALSE is returned. ##### Parameters -*key* string -*value* string +*key* +*value* String, value to push in key ##### Return value *BOOL* Tue in case of success, False in case of Failure. ##### Examples @@ -198,8 +198,7 @@ Return and remove the last element of the list. ##### Parameters *key* ##### Return value -*STRING* -*BOOL* +*STRING* if command executed successfully, *BOOL* False if failure. ##### Examples <pre> $redis->rpush('key1', 'A'); @@ -214,7 +213,7 @@ Return and remove the first element of the list. ##### *Parameters* *key* ##### *Return value* -*STRING* in case of success (key exists) +*STRING* in case of success (key exists) *BOOL* False in case of failure (key didn't exist) ##### *Example* <pre> @@ -270,7 +269,7 @@ Return False is the identify a data type *index* ##### *Return value* -*String* the element at this index +*String* the element at this index *Bool* False if the key identify a non-string data type, or no values corresponds at this index in the list Key. ##### *Example* <pre> @@ -329,7 +328,7 @@ Trim an existing list so that it will contain only the specified range of elemen *start* *stop* ##### *Return value* -*Array* +*Array* *Bool* return False if the key identify a non-list value. ##### *Example* <pre> @@ -350,7 +349,7 @@ Remove the first count occurences of the value element from the list. If count e *value* ##### *Return value* -*LONG* the number of removed elements +*LONG* the number of removed elements *BOOL* False if data type of the value identified by key is not a list. ##### *Example* <pre> @@ -446,18 +445,30 @@ Return the cardinality of the set identified by key. ##### *Return value* *LONG* the cardinality of the set identified by key, 0 if set didn't exist. ##### *Example* +<pre> +$redis->sadd('key1' , 'set1'); +$redis->sadd('key1' , 'set2'); +$redis->sadd('key1' , 'set3'); /* 'key1' => {'set1', 'set2', 'set3'}*/ +$redis->sSize('key1'); /* 3 */ +$redis->sSize('keyX'); /* 0 */ +</pre> ## spop ##### *Description* +Remove and retrun a random element from the set value at Key. ##### *Parameters* +*key* ##### *Return value* +*String* popped value +*Bool* False if set identified by key is empty or didn't exist. ##### *Example* <pre> $redis->sadd('key1' , 'set1'); $redis->sadd('key1' , 'set2'); -$redis->sadd('key1' , 'set3'); /* 'key1' => {'set1', 'set2', 'set3'}*/ -$redis->sSize('key1'); /* 3 */ -$redis->sSize('keyX'); /* 0 */ +$redis->sadd('key1' , 'set3'); /* 'key1' => {'set3', 'set1', 'set2'}*/ +$redis->spop('key1'); /* 'set1', 'key1' => {'set3', 'set2'} */ +$redis->spop('key1'); /* 'set3', 'key1' => {'set2'} */ + </pre> ## sinter |