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-12-18 15:00:45 +0300
committerMichael Grunder <michael.grunder@gmail.com>2020-02-07 01:14:46 +0300
commitc94e28f1ebabdfceb722ad78eff75ce4fc57f5a3 (patch)
tree39ff8750ed2cf4d1930f98979681a674e90b1e21 /redis.c
parentb1724b84828eac58c4d3e29b190bd49dc55c209a (diff)
Add RedisSentinel class and tests
Diffstat (limited to 'redis.c')
-rw-r--r--redis.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/redis.c b/redis.c
index 0b745389..339328f1 100644
--- a/redis.c
+++ b/redis.c
@@ -22,16 +22,16 @@
#include "config.h"
#endif
-#include "common.h"
-#include "ext/standard/info.h"
#include "php_redis.h"
-#include "redis_commands.h"
#include "redis_array.h"
#include "redis_cluster.h"
+#include "redis_commands.h"
+#include "redis_sentinel.h"
#include <zend_exceptions.h>
+#include <ext/standard/info.h>
#ifdef PHP_SESSION
-#include "ext/session/php_session.h"
+#include <ext/session/php_session.h>
#endif
#include "library.h"
@@ -48,6 +48,7 @@ extern ps_module ps_mod_redis_cluster;
extern zend_class_entry *redis_array_ce;
extern zend_class_entry *redis_cluster_ce;
extern zend_class_entry *redis_cluster_exception_ce;
+extern zend_class_entry *redis_sentinel_ce;
zend_class_entry *redis_ce;
zend_class_entry *redis_exception_ce;
@@ -56,6 +57,7 @@ extern int le_cluster_slot_cache;
extern zend_function_entry redis_array_functions[];
extern zend_function_entry redis_cluster_functions[];
+extern zend_function_entry redis_sentinel_functions[];
int le_redis_pconnect;
@@ -754,6 +756,7 @@ PHP_MINIT_FUNCTION(redis)
zend_class_entry redis_class_entry;
zend_class_entry redis_array_class_entry;
zend_class_entry redis_cluster_class_entry;
+ zend_class_entry redis_sentinel_class_entry;
zend_class_entry redis_exception_class_entry;
zend_class_entry redis_cluster_exception_class_entry;
@@ -780,6 +783,11 @@ PHP_MINIT_FUNCTION(redis)
redis_cluster_ce = zend_register_internal_class(&redis_cluster_class_entry);
redis_cluster_ce->create_object = create_cluster_context;
+ /* RedisSentinel class */
+ INIT_CLASS_ENTRY(redis_sentinel_class_entry, "RedisSentinel", redis_sentinel_functions);
+ redis_sentinel_ce = zend_register_internal_class(&redis_sentinel_class_entry);
+ redis_sentinel_ce->create_object = create_sentinel_object;
+
/* Register our cluster cache list item */
le_cluster_slot_cache = zend_register_list_destructors_ex(NULL, cluster_cache_dtor,
"Redis cluster slot cache",