File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2828#include "redis_commands.h"
2929#include "redis_sentinel.h"
3030#include <standard/php_random.h>
31+ #include <ext/spl/spl_exceptions.h>
3132#include <zend_exceptions.h>
3233#include <ext/standard/info.h>
3334#include <ext/hash/php_hash.h>
@@ -436,7 +437,6 @@ static PHP_GINIT_FUNCTION(redis)
436437PHP_MINIT_FUNCTION (redis )
437438{
438439 struct timeval tv ;
439- zend_class_entry * exception_ce = NULL ;
440440
441441 /* Seed random generator (for RedisCluster failover) */
442442 gettimeofday (& tv , NULL );
@@ -462,14 +462,8 @@ PHP_MINIT_FUNCTION(redis)
462462 "Redis cluster slot cache" ,
463463 module_number );
464464
465- /* Base Exception class */
466- exception_ce = zend_hash_str_find_ptr (CG (class_table ), "RuntimeException" , sizeof ("RuntimeException" ) - 1 );
467- if (exception_ce == NULL ) {
468- exception_ce = zend_exception_get_default ();
469- }
470-
471465 /* RedisException class */
472- redis_exception_ce = register_class_RedisException (exception_ce );
466+ redis_exception_ce = register_class_RedisException (spl_ce_RuntimeException );
473467
474468 /* Add shared class constants to Redis and RedisCluster objects */
475469 add_class_constants (redis_ce , 0 );
Original file line number Diff line number Diff line change 2525#include "crc16.h"
2626#include "redis_cluster.h"
2727#include "redis_commands.h"
28+ #include <ext/spl/spl_exceptions.h>
2829#include <zend_exceptions.h>
2930#include "library.h"
3031#include <php_variables.h>
@@ -44,17 +45,10 @@ zend_class_entry *redis_cluster_exception_ce;
4445
4546PHP_MINIT_FUNCTION (redis_cluster )
4647{
47- zend_class_entry * exception_ce = NULL ;
48-
4948 redis_cluster_ce = register_class_RedisCluster ();
5049 redis_cluster_ce -> create_object = create_cluster_context ;
5150
52- /* Base Exception class */
53- exception_ce = zend_hash_str_find_ptr (CG (class_table ), "RuntimeException" , sizeof ("RuntimeException" ) - 1 );
54- if (exception_ce == NULL ) {
55- exception_ce = zend_exception_get_default ();
56- }
57- redis_cluster_exception_ce = register_class_RedisClusterException (exception_ce );
51+ redis_cluster_exception_ce = register_class_RedisClusterException (spl_ce_RuntimeException );
5852
5953 return SUCCESS ;
6054}
You can’t perform that action at this time.
0 commit comments