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>2021-03-06 21:15:36 +0300
committerPavlo Yatsukhnenko <yatsukhnenko@gmail.com>2021-03-06 21:15:36 +0300
commit5d50fef961d35ee8563ca7719d064b8dc7148b04 (patch)
tree549acf3f6c7ca3989ca7cbc0e19a03280b599d59 /redis.c
parent963f2a9624218ce80a39327689fb05be1d776fbc (diff)
[WIP] Issue #1894
Add Redis::zdiff and Redis::zdiffstore commands
Diffstat (limited to 'redis.c')
-rw-r--r--redis.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/redis.c b/redis.c
index 91eba589..10b0e159 100644
--- a/redis.c
+++ b/redis.c
@@ -115,6 +115,16 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_connect, 0, 0, 1)
ZEND_ARG_INFO(0, retry_interval)
ZEND_END_ARG_INFO()
+ZEND_BEGIN_ARG_INFO_EX(arginfo_zdiff, 0, 0, 1)
+ ZEND_ARG_ARRAY_INFO(0, keys, 0)
+ ZEND_ARG_ARRAY_INFO(0, options, 0)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_zdiffstore, 0, 0, 2)
+ ZEND_ARG_INFO(0, destination)
+ ZEND_ARG_ARRAY_INFO(0, keys, 0)
+ZEND_END_ARG_INFO()
+
ZEND_BEGIN_ARG_INFO_EX(arginfo_info, 0, 0, 0)
ZEND_ARG_INFO(0, option)
ZEND_END_ARG_INFO()
@@ -472,6 +482,8 @@ static zend_function_entry redis_functions[] = {
PHP_ME(Redis, zRevRangeByScore, arginfo_zrangebyscore, ZEND_ACC_PUBLIC)
PHP_ME(Redis, zRevRank, arginfo_key_member, ZEND_ACC_PUBLIC)
PHP_ME(Redis, zScore, arginfo_key_member, ZEND_ACC_PUBLIC)
+ PHP_ME(Redis, zdiff, arginfo_zdiff, ZEND_ACC_PUBLIC)
+ PHP_ME(Redis, zdiffstore, arginfo_zdiffstore, ZEND_ACC_PUBLIC)
PHP_ME(Redis, zinterstore, arginfo_zstore, ZEND_ACC_PUBLIC)
PHP_ME(Redis, zscan, arginfo_kscan, ZEND_ACC_PUBLIC)
PHP_ME(Redis, zunionstore, arginfo_zstore, ZEND_ACC_PUBLIC)
@@ -2299,6 +2311,18 @@ PHP_METHOD(Redis, zIncrBy)
}
/* }}} */
+/* {{{ proto array Redis::zdiff(array keys, array options) */
+PHP_METHOD(Redis, zdiff) {
+ REDIS_PROCESS_CMD(zdiff, redis_zdiff_response);
+}
+/* }}} */
+
+/* {{{ proto array Redis::zdiffstore(string destination, array keys) */
+PHP_METHOD(Redis, zdiffstore) {
+ REDIS_PROCESS_CMD(zdiffstore, redis_long_response);
+}
+/* }}} */
+
/* zinterstore */
PHP_METHOD(Redis, zinterstore) {
REDIS_PROCESS_KW_CMD("ZINTERSTORE", redis_zinter_cmd, redis_long_response);