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:
-rw-r--r--README.markdown4
-rwxr-xr-xredis.c7
2 files changed, 5 insertions, 6 deletions
diff --git a/README.markdown b/README.markdown
index c28cbff7..08c74ef3 100644
--- a/README.markdown
+++ b/README.markdown
@@ -142,11 +142,11 @@ $redis->delete('key1', 'key2'); /* return 2 */
$redis->delete(array('key3', 'key4')); /* return 2 */
</pre>
-## multi, exec.
+## multi, exec, discard.
##### Description
Enter and exit transactional mode.
##### Parameters
-(optional) `Redis::MULTI` or `Redis::PIPELINE`. Defaults to `Redis::MULTI`. A `Redis::MULTI` block of commands runs as a single transaction; a `Redis::PIPELINE` block is simply transmitted faster to the server, but without any guarantee of atomicity.
+(optional) `Redis::MULTI` or `Redis::PIPELINE`. Defaults to `Redis::MULTI`. A `Redis::MULTI` block of commands runs as a single transaction; a `Redis::PIPELINE` block is simply transmitted faster to the server, but without any guarantee of atomicity. `discard` cancels a transaction.
##### Return value
`multi()` returns the Redis instance and enters multi-mode. Once in multi-mode, all subsequent method calls return the same object until `exec()` is called.
##### Example
diff --git a/redis.c b/redis.c
index 118cbf3a..da4d97c6 100755
--- a/redis.c
+++ b/redis.c
@@ -3970,8 +3970,7 @@ PHP_METHOD(Redis, multi)
if(multi_value == REDIS_MULTI || multi_value == REDIS_PIPELINE) {
set_flag(object, multi_value);
} else {
- /* php_printf("error[%f] !! \n", multi_value); */
- exit(-1);
+ RETURN_FALSE;
}
current = NULL;
@@ -4394,7 +4393,7 @@ PHP_METHOD(Redis, subscribe)
redis_sock TSRMLS_CC);
zval **type, **channel, **data;
- if(Z_TYPE_P(z_tab) == IS_NULL) {
+ if(Z_TYPE_P(z_tab) != IS_ARRAY) {
//ERROR
break;
}
@@ -4468,7 +4467,7 @@ PHP_METHOD(Redis, subscribe)
* response format :
* array(
* channel_0 => TRUE|FALSE,
- * channel_1 => TRUE_FALSE,
+ * channel_1 => TRUE|FALSE,
* ...
* channel_n => TRUE|FALSE
* );