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 28
28
#include "redis_cluster.h"
29
29
#include "redis_commands.h"
30
30
#include <zend_exceptions.h>
31
+ #include <ext/spl/spl_exceptions.h>
31
32
#include "library.h"
32
33
#include <php_variables.h>
33
34
#include <SAPI.h>
@@ -234,27 +235,22 @@ static void ht_free_node(zval *data) {
234
235
}
235
236
236
237
/* 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
+ }
257
252
#endif
253
+ return zend_ce_exception ;
258
254
}
259
255
260
256
/* 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) {
101
101
resp_func(INTERNAL_FUNCTION_PARAM_PASSTHRU, c, ctx);
102
102
103
103
/* 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 );
105
105
106
106
/* Create cluster context */
107
107
zend_object * create_cluster_context (zend_class_entry * class_type
You can’t perform that action at this time.
0 commit comments