From 3675f442e413bd864c12787c3b383b110ed26963 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Mon, 4 Jul 2022 14:27:20 +0200 Subject: mark auth param as sensitive for PHP 8.2 refactor MINIT (split in each class sources file) use @generate-class-entries in stub files add RedisException and RedisClusterException in stub files --- redis_cluster.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'redis_cluster.c') diff --git a/redis_cluster.c b/redis_cluster.c index 5634560f..e3451899 100644 --- a/redis_cluster.c +++ b/redis_cluster.c @@ -38,12 +38,25 @@ zend_class_entry *redis_cluster_exception_ce; #if PHP_VERSION_ID < 80000 #include "redis_cluster_legacy_arginfo.h" #else +#include "zend_attributes.h" #include "redis_cluster_arginfo.h" #endif -extern const zend_function_entry *redis_cluster_get_methods(void) +PHP_MINIT_FUNCTION(redis_cluster) { - return class_RedisCluster_methods; + zend_class_entry *exception_ce = NULL; + + redis_cluster_ce = register_class_RedisCluster(); + redis_cluster_ce->create_object = create_cluster_context; + + /* Base Exception class */ + exception_ce = zend_hash_str_find_ptr(CG(class_table), "RuntimeException", sizeof("RuntimeException") - 1); + if (exception_ce == NULL) { + exception_ce = zend_exception_get_default(); + } + redis_cluster_exception_ce = register_class_RedisClusterException(exception_ce); + + return SUCCESS; } /* Handlers for RedisCluster */ -- cgit v1.2.3