diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2019-05-24 14:41:38 +0200 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2019-05-27 09:36:25 +0200 |
commit | e6fac86dc35b876d2958ce77c01bb05bd7068ac3 (patch) | |
tree | 779eab359ecd2c14c6a642ac0d2dd228da60b372 /Zend/zend_execute_API.c | |
parent | cd6b7ebb680c66b4de0274bbc0c8b4a52ae09a88 (diff) | |
download | php-git-e6fac86dc35b876d2958ce77c01bb05bd7068ac3.tar.gz |
Accept flags argument in zend_lookup_class_ex()
Instead of a single boolean, so we have space for extension here.
Diffstat (limited to 'Zend/zend_execute_API.c')
-rw-r--r-- | Zend/zend_execute_API.c | 14 |
1 files changed, 7 insertions, 7 deletions
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; } |