File tree Expand file tree Collapse file tree 2 files changed +17
-21
lines changed Expand file tree Collapse file tree 2 files changed +17
-21
lines changed Original file line number Diff line number Diff line change 2828#include "redis_cluster.h"
2929#include "redis_commands.h"
3030#include <zend_exceptions.h>
31+ #include <ext/spl/spl_exceptions.h>
3132#include "library.h"
3233#include <php_variables.h>
3334#include <SAPI.h>
@@ -234,27 +235,22 @@ static void ht_free_node(zval *data) {
234235}
235236
236237/* Initialize/Register our RedisCluster exceptions */
237- PHPAPI zend_class_entry * rediscluster_get_exception_base (int root TSRMLS_DC ) {
238- #if HAVE_SPL
239- if (!root ) {
240- if (!spl_rte_ce ) {
241- zend_class_entry * pce ;
242-
243- if ((pce = zend_hash_str_find_ptr (CG (class_table ), "runtimeexception" , sizeof ("runtimeexception" ) - 1 )) != NULL )
244- {
245- spl_rte_ce = pce ;
246- return pce ;
247- }
248- } else {
249- return spl_rte_ce ;
250- }
251- }
252- #endif
253- #if (PHP_MAJOR_VERSION == 5 ) && (PHP_MINOR_VERSION < 2 )
254- return zend_exception_get_default ();
255- #else
256- return zend_exception_get_default (TSRMLS_C );
238+ PHP_REDIS_API zend_class_entry * rediscluster_get_exception_base (int root ) {
239+ #if defined(HAVE_SPL )
240+ if (!root ) {
241+ if (!spl_ce_RuntimeException ) {
242+ zend_class_entry * pce ;
243+
244+ if ((pce = zend_hash_str_find_ptr (CG (class_table ), "runtimeexception" , sizeof ("RuntimeException" ) - 1 ))) {
245+ spl_ce_RuntimeException = pce ;
246+ return pce ;
247+ }
248+ } else {
249+ return spl_ce_RuntimeException ;
250+ }
251+ }
257252#endif
253+ return zend_ce_exception ;
258254}
259255
260256/* Create redisCluster context */
Original file line number Diff line number Diff line change @@ -101,7 +101,7 @@ static inline redisCluster *php_redis_fetch_object(zend_object *obj) {
101101 resp_func(INTERNAL_FUNCTION_PARAM_PASSTHRU, c, ctx);
102102
103103/* For the creation of RedisCluster specific exceptions */
104- PHP_REDIS_API zend_class_entry * rediscluster_get_exception_base (int root TSRMLS_DC );
104+ PHP_REDIS_API zend_class_entry * rediscluster_get_exception_base (int root );
105105
106106/* Create cluster context */
107107zend_object * create_cluster_context (zend_class_entry * class_type
You can’t perform that action at this time.
0 commit comments