From e6fac86dc35b876d2958ce77c01bb05bd7068ac3 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Fri, 24 May 2019 14:41:38 +0200 Subject: Accept flags argument in zend_lookup_class_ex() Instead of a single boolean, so we have space for extension here. --- Zend/zend_execute_API.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'Zend/zend_execute_API.c') diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index 0d5ceb8627..575f285167 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -886,7 +886,7 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache) / } /* }}} */ -ZEND_API zend_class_entry *zend_lookup_class_ex(zend_string *name, zend_string *key, int use_autoload) /* {{{ */ +ZEND_API zend_class_entry *zend_lookup_class_ex(zend_string *name, zend_string *key, uint32_t flags) /* {{{ */ { zend_class_entry *ce = NULL; zval args[1], *zv; @@ -925,7 +925,7 @@ ZEND_API zend_class_entry *zend_lookup_class_ex(zend_string *name, zend_string * /* The compiler is not-reentrant. Make sure we __autoload() only during run-time * (doesn't impact functionality of __autoload() */ - if (!use_autoload || zend_is_compiling()) { + if ((flags & ZEND_FETCH_CLASS_NO_AUTOLOAD) || zend_is_compiling()) { if (!key) { zend_string_release_ex(lc_name, 0); } @@ -1006,7 +1006,7 @@ ZEND_API zend_class_entry *zend_lookup_class_ex(zend_string *name, zend_string * ZEND_API zend_class_entry *zend_lookup_class(zend_string *name) /* {{{ */ { - return zend_lookup_class_ex(name, NULL, 1); + return zend_lookup_class_ex(name, NULL, 0); } /* }}} */ @@ -1397,8 +1397,8 @@ check_fetch_type: } if (fetch_type & ZEND_FETCH_CLASS_NO_AUTOLOAD) { - return zend_lookup_class_ex(class_name, NULL, 0); - } else if ((ce = zend_lookup_class_ex(class_name, NULL, 1)) == NULL) { + return zend_lookup_class_ex(class_name, NULL, fetch_type); + } else if ((ce = zend_lookup_class_ex(class_name, NULL, fetch_type)) == NULL) { if (!(fetch_type & ZEND_FETCH_CLASS_SILENT) && !EG(exception)) { if (fetch_sub_type == ZEND_FETCH_CLASS_INTERFACE) { zend_throw_or_error(fetch_type, NULL, "Interface '%s' not found", ZSTR_VAL(class_name)); @@ -1419,8 +1419,8 @@ zend_class_entry *zend_fetch_class_by_name(zend_string *class_name, zend_string zend_class_entry *ce; if (fetch_type & ZEND_FETCH_CLASS_NO_AUTOLOAD) { - return zend_lookup_class_ex(class_name, key, 0); - } else if ((ce = zend_lookup_class_ex(class_name, key, 1)) == NULL) { + return zend_lookup_class_ex(class_name, key, fetch_type); + } else if ((ce = zend_lookup_class_ex(class_name, key, fetch_type)) == NULL) { if (fetch_type & ZEND_FETCH_CLASS_SILENT) { return NULL; } -- cgit v1.2.1