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>2019-06-20 16:50:13 +0300
committerMichael Grunder <michael.grunder@gmail.com>2019-06-21 21:55:13 +0300
commit235a27e7c088bbf5e5dbbd8b4a2684b600d6c79a (patch)
tree0df67726e5720328f919ecb4e5a30dd644707d1c /redis.c
parent8206b14749e2583895023312c2143116c2480a50 (diff)
Issue #1577
Remove checking of version of msgpack. Allow to disable json serializer. Fix tests.
Diffstat (limited to 'redis.c')
-rw-r--r--redis.c40
1 files changed, 32 insertions, 8 deletions
diff --git a/redis.c b/redis.c
index 15a5038e..84139e8d 100644
--- a/redis.c
+++ b/redis.c
@@ -477,6 +477,12 @@ static const zend_module_dep redis_deps[] = {
#ifdef HAVE_REDIS_IGBINARY
ZEND_MOD_REQUIRED("igbinary")
#endif
+#ifdef HAVE_REDIS_MSGPACK
+ ZEND_MOD_REQUIRED("msgpack")
+#endif
+#ifdef HAVE_REDIS_JSON
+ ZEND_MOD_REQUIRED("json")
+#endif
#ifdef PHP_SESSION
ZEND_MOD_REQUIRED("session")
#endif
@@ -809,18 +815,36 @@ PHP_MSHUTDOWN_FUNCTION(redis)
return SUCCESS;
}
-static const char *get_available_serializers(void) {
-#ifdef HAVE_REDIS_IGBINARY
- #ifdef HAVE_REDIS_MSGPACK
- return "php, igbinary, msgpack";
+static const char *
+get_available_serializers(void)
+{
+#ifdef HAVE_REDIS_JSON
+ #ifdef HAVE_REDIS_IGBINARY
+ #ifdef HAVE_REDIS_MSGPACK
+ return "php, json, igbinary, msgpack";
+ #else
+ return "php, json, igbinary";
+ #endif
#else
- return "php, igbinary";
+ #ifdef HAVE_REDIS_MSGPACK
+ return "php, json, msgpack";
+ #else
+ return "php, json";
+ #endif
#endif
#else
- #ifdef HAVE_REDIS_MSGPACK
- return "php, msgpack";
+ #ifdef HAVE_REDIS_IGBINARY
+ #ifdef HAVE_REDIS_MSGPACK
+ return "php, igbinary, msgpack";
+ #else
+ return "php, igbinary";
+ #endif
#else
- return "php";
+ #ifdef HAVE_REDIS_MSGPACK
+ return "php, msgpack";
+ #else
+ return "php";
+ #endif
#endif
#endif
}