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>2020-06-08 00:09:30 +0300
committerGitHub <noreply@github.com>2020-06-08 00:09:30 +0300
commit04def9fbe2194b3b711362de57260a6cd5216e69 (patch)
tree35ef5d8eaa6e50f360ad63a5f444e4b64782a30f /redis.c
parent5ca4141c72e23816f146b49877a6a4b8098b34c6 (diff)
Rebased LZ4 PR (#1781)
LZ4 compression by @iliaal
Diffstat (limited to 'redis.c')
-rw-r--r--redis.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/redis.c b/redis.c
index 46278abd..71e301ad 100644
--- a/redis.c
+++ b/redis.c
@@ -40,6 +40,10 @@
#include <zstd.h>
#endif
+#ifdef HAVE_REDIS_LZ4
+#include <lz4.h>
+#endif
+
#ifdef PHP_SESSION
extern ps_module ps_mod_redis;
extern ps_module ps_mod_redis_cluster;
@@ -719,6 +723,10 @@ static void add_class_constants(zend_class_entry *ce, int is_cluster) {
zend_declare_class_constant_long(ce, ZEND_STRL("COMPRESSION_ZSTD_MAX"), ZSTD_maxCLevel());
#endif
+#ifdef HAVE_REDIS_LZ4
+ zend_declare_class_constant_long(ce, ZEND_STRL("COMPRESSION_LZ4"), REDIS_COMPRESSION_LZ4);
+#endif
+
/* scan options*/
zend_declare_class_constant_long(ce, ZEND_STRL("OPT_SCAN"), REDIS_OPT_SCAN);
zend_declare_class_constant_long(ce, ZEND_STRL("SCAN_RETRY"), REDIS_SCAN_RETRY);
@@ -887,6 +895,12 @@ PHP_MINFO_FUNCTION(redis)
}
smart_str_appends(&names, "zstd");
#endif
+#ifdef HAVE_REDIS_LZ4
+ if (names.s) {
+ smart_str_appends(&names, ", ");
+ }
+ smart_str_appends(&names, "lz4");
+#endif
if (names.s) {
smart_str_0(&names);
php_info_print_table_row(2, "Available compression", ZSTR_VAL(names.s));