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:
authorPavlo Yatsukhnenko <yatsukhnenko@gmail.com>2018-03-22 23:57:32 +0300
committerPavlo Yatsukhnenko <yatsukhnenko@gmail.com>2018-04-22 22:23:35 +0300
commitbeb6e8f3aba298f79d23730a2ce95cef47698bd1 (patch)
treec1997ed5db60e09883ce2828e59ef26fec0cea24 /redis_commands.c
parent80d2a91744712c6026bf2707861510a4ba319ade (diff)
Issue #1302
Handle async parameter for Redis::flushDb and Redis::flushAll TODO: implementation for RedisArray and RedisCluster
Diffstat (limited to 'redis_commands.c')
-rw-r--r--redis_commands.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/redis_commands.c b/redis_commands.c
index 629ec105..739142e9 100644
--- a/redis_commands.c
+++ b/redis_commands.c
@@ -415,6 +415,24 @@ int redis_key_cmd(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock,
return SUCCESS;
}
+int redis_flush_cmd(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock,
+ char *kw, char **cmd, int *cmd_len, short *slot, void **ctx)
+{
+ zend_bool async = 0;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &async) == FAILURE) {
+ return FAILURE;
+ }
+
+ if (async) {
+ *cmd_len = REDIS_CMD_SPPRINTF(cmd, kw, "s", "ASYNC", sizeof("ASYNC") - 1);
+ } else {
+ *cmd_len = REDIS_CMD_SPPRINTF(cmd, kw, "");
+ }
+
+ return SUCCESS;
+}
+
/* Generic command where we take a key and a double */
int redis_key_dbl_cmd(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock,
char *kw, char **cmd, int *cmd_len, short *slot,