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:
authormichael-grunder <michael.grunder@gmail.com>2021-04-19 01:27:59 +0300
committermichael-grunder <michael.grunder@gmail.com>2021-06-22 20:16:23 +0300
commit4cb4cd0ee26fdd1a07f468b976f990dbb9de7ed0 (patch)
tree16046fc52ef712839ae0a252d20e9a9dacb69c21 /redis_cluster.c
parent2d72c55d7d0402bfdf147ba71cead38d2573e203 (diff)
Separate compression and create utility methods
This commit splits compression and serialization into two distinct parts and adds some utility functions so the user can compress/uncompress or pack/unpack data explicily. See #1939
Diffstat (limited to 'redis_cluster.c')
-rw-r--r--redis_cluster.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/redis_cluster.c b/redis_cluster.c
index 402c23b7..8c451994 100644
--- a/redis_cluster.c
+++ b/redis_cluster.c
@@ -110,6 +110,10 @@ zend_function_entry redis_cluster_functions[] = {
PHP_ME(RedisCluster, _redir, arginfo_void, ZEND_ACC_PUBLIC)
PHP_ME(RedisCluster, _serialize, arginfo_value, ZEND_ACC_PUBLIC)
PHP_ME(RedisCluster, _unserialize, arginfo_value, ZEND_ACC_PUBLIC)
+ PHP_ME(RedisCluster, _compress, arginfo_value, ZEND_ACC_PUBLIC)
+ PHP_ME(RedisCluster, _uncompress, arginfo_value, ZEND_ACC_PUBLIC)
+ PHP_ME(RedisCluster, _pack, arginfo_value, ZEND_ACC_PUBLIC)
+ PHP_ME(RedisCluster, _unpack, arginfo_value, ZEND_ACC_PUBLIC)
PHP_ME(RedisCluster, acl, arginfo_acl_cl, ZEND_ACC_PUBLIC)
PHP_ME(RedisCluster, append, arginfo_key_value, ZEND_ACC_PUBLIC)
PHP_ME(RedisCluster, bgrewriteaof, arginfo_key_or_address, ZEND_ACC_PUBLIC)
@@ -1970,6 +1974,27 @@ PHP_METHOD(RedisCluster, _unserialize) {
}
/* }}} */
+PHP_METHOD(RedisCluster, _compress) {
+ redisCluster *c = GET_CONTEXT();
+ redis_compress_handler(INTERNAL_FUNCTION_PARAM_PASSTHRU, c->flags);
+}
+
+PHP_METHOD(RedisCluster, _uncompress) {
+ redisCluster *c = GET_CONTEXT();
+ redis_uncompress_handler(INTERNAL_FUNCTION_PARAM_PASSTHRU, c->flags,
+ redis_cluster_exception_ce);
+}
+
+PHP_METHOD(RedisCluster, _pack) {
+ redisCluster *c = GET_CONTEXT();
+ redis_pack_handler(INTERNAL_FUNCTION_PARAM_PASSTHRU, c->flags);
+}
+
+PHP_METHOD(RedisCluster, _unpack) {
+ redisCluster *c = GET_CONTEXT();
+ redis_unpack_handler(INTERNAL_FUNCTION_PARAM_PASSTHRU, c->flags);
+}
+
/* {{{ proto array RedisCluster::_masters() */
PHP_METHOD(RedisCluster, _masters) {
redisCluster *c = GET_CONTEXT();