diff options
author | Michael Grunder <michael.grunder@gmail.com> | 2020-06-08 00:09:30 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-08 00:09:30 +0300 |
commit | 04def9fbe2194b3b711362de57260a6cd5216e69 (patch) | |
tree | 35ef5d8eaa6e50f360ad63a5f444e4b64782a30f /redis.c | |
parent | 5ca4141c72e23816f146b49877a6a4b8098b34c6 (diff) |
Rebased LZ4 PR (#1781)
LZ4 compression by @iliaal
Diffstat (limited to 'redis.c')
-rw-r--r-- | redis.c | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -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)); |