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:
authorRemi Collet <remi@remirepo.net>2022-07-04 15:44:27 +0300
committerRemi Collet <remi@php.net>2022-07-18 14:46:10 +0300
commit3cd5ac1e27796a559fea50f0a0eb716030ac9720 (patch)
tree82e74c1d2ca655a2270f7f4562f930ef2bedd8d5 /redis.c
parent3675f442e413bd864c12787c3b383b110ed26963 (diff)
use spl_ce_RuntimeException (exists since 5.6)
Diffstat (limited to 'redis.c')
-rw-r--r--redis.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/redis.c b/redis.c
index 357405ec..8c4cada6 100644
--- a/redis.c
+++ b/redis.c
@@ -28,6 +28,7 @@
#include "redis_commands.h"
#include "redis_sentinel.h"
#include <standard/php_random.h>
+#include <ext/spl/spl_exceptions.h>
#include <zend_exceptions.h>
#include <ext/standard/info.h>
#include <ext/hash/php_hash.h>
@@ -436,7 +437,6 @@ static PHP_GINIT_FUNCTION(redis)
PHP_MINIT_FUNCTION(redis)
{
struct timeval tv;
- zend_class_entry *exception_ce = NULL;
/* Seed random generator (for RedisCluster failover) */
gettimeofday(&tv, NULL);
@@ -462,14 +462,8 @@ PHP_MINIT_FUNCTION(redis)
"Redis cluster slot cache",
module_number);
- /* 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();
- }
-
/* RedisException class */
- redis_exception_ce = register_class_RedisException(exception_ce);
+ redis_exception_ce = register_class_RedisException(spl_ce_RuntimeException);
/* Add shared class constants to Redis and RedisCluster objects */
add_class_constants(redis_ce, 0);