diff options
author | Marin Bezhanov <marin.bezhanov@gmail.com> | 2019-02-17 14:05:58 +0300 |
---|---|---|
committer | Marin Bezhanov <marin.bezhanov@gmail.com> | 2019-02-17 14:05:58 +0300 |
commit | 46f035615ecaf839cfe515dac39f209d50689461 (patch) | |
tree | 977e69e8f4e3e8043757c4204f9a1addf2d2c89a /redis_cluster.c | |
parent | 22d81a94eee2ea613fc515e1d714b73142d46241 (diff) |
Add ZPOPMAX and ZPOPMIN support
Diffstat (limited to 'redis_cluster.c')
-rw-r--r-- | redis_cluster.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/redis_cluster.c b/redis_cluster.c index eb4726a3..7087e478 100644 --- a/redis_cluster.c +++ b/redis_cluster.c @@ -274,6 +274,8 @@ zend_function_entry redis_cluster_functions[] = { PHP_ME(RedisCluster, zincrby, arginfo_zincrby, ZEND_ACC_PUBLIC) PHP_ME(RedisCluster, zinterstore, arginfo_zstore, ZEND_ACC_PUBLIC) PHP_ME(RedisCluster, zlexcount, arginfo_key_min_max, ZEND_ACC_PUBLIC) + PHP_ME(RedisCluster, zpopmax, arginfo_key, ZEND_ACC_PUBLIC) + PHP_ME(RedisCluster, zpopmin, arginfo_key, ZEND_ACC_PUBLIC) PHP_ME(RedisCluster, zrange, arginfo_zrange, ZEND_ACC_PUBLIC) PHP_ME(RedisCluster, zrangebylex, arginfo_zrangebylex, ZEND_ACC_PUBLIC) PHP_ME(RedisCluster, zrangebyscore, arginfo_zrangebyscore, ZEND_ACC_PUBLIC) @@ -1844,6 +1846,30 @@ PHP_METHOD(RedisCluster, zremrangebylex) { } /* }}} */ +/* {{{ proto array RedisCluster::zpopmax(string key) */ +PHP_METHOD(RedisCluster, zpopmax) { + if (ZEND_NUM_ARGS() == 1) { + CLUSTER_PROCESS_KW_CMD("ZPOPMAX", redis_key_cmd, cluster_mbulk_resp, 0); + } else if (ZEND_NUM_ARGS() == 2) { + CLUSTER_PROCESS_KW_CMD("ZPOPMAX", redis_key_long_cmd, cluster_mbulk_resp, 0); + } else { + ZEND_WRONG_PARAM_COUNT(); + } +} +/* }}} */ + +/* {{{ proto array RedisCluster::zpopmin(string key) */ +PHP_METHOD(RedisCluster, zpopmin) { + if (ZEND_NUM_ARGS() == 1) { + CLUSTER_PROCESS_KW_CMD("ZPOPMIN", redis_key_cmd, cluster_mbulk_resp, 0); + } else if (ZEND_NUM_ARGS() == 2) { + CLUSTER_PROCESS_KW_CMD("ZPOPMIN", redis_key_long_cmd, cluster_mbulk_resp, 0); + } else { + ZEND_WRONG_PARAM_COUNT(); + } +} +/* }}} */ + /* {{{ proto RedisCluster::sort(string key, array options) */ PHP_METHOD(RedisCluster, sort) { redisCluster *c = GET_CONTEXT(); |