diff options
author | Jakub Zelenka <bukka@php.net> | 2016-06-19 17:05:48 +0100 |
---|---|---|
committer | Jakub Zelenka <bukka@php.net> | 2016-06-19 17:05:48 +0100 |
commit | e63a8540a60e95aa5bd8e269add1b02afcc1b79b (patch) | |
tree | b83a144eec24cc81adab0b9a778f7a730d8df79e /ext/spl/php_spl.c | |
parent | 7a4cc73641bb3eb878f7184bcbd026ee663cf2a9 (diff) | |
parent | 53071e647049f099f7f7a0771ddb63fc2cdd621c (diff) | |
download | php-git-e63a8540a60e95aa5bd8e269add1b02afcc1b79b.tar.gz |
Merge branch 'openssl_error_store' into openssl_aead
Diffstat (limited to 'ext/spl/php_spl.c')
-rw-r--r-- | ext/spl/php_spl.c | 22 |
1 files changed, 1 insertions, 21 deletions
diff --git a/ext/spl/php_spl.c b/ext/spl/php_spl.c index 9c7611d117..87fb2ae37b 100644 --- a/ext/spl/php_spl.c +++ b/ext/spl/php_spl.c @@ -307,7 +307,7 @@ static int spl_autoload(zend_string *class_name, zend_string *lc_name, const cha Default implementation for __autoload() */ PHP_FUNCTION(spl_autoload) { - int found = 0, pos_len, pos1_len; + int pos_len, pos1_len; char *pos, *pos1; zend_string *class_name, *lc_name, *file_exts = SPL_G(autoload_extensions); @@ -333,32 +333,12 @@ PHP_FUNCTION(spl_autoload) pos1_len = pos_len; } if (spl_autoload(class_name, lc_name, pos, pos1_len)) { - found = 1; break; /* loaded */ } pos = pos1 ? pos1 + 1 : NULL; pos_len = pos1? pos_len - pos1_len - 1 : 0; } zend_string_free(lc_name); - - if (!found && !SPL_G(autoload_running)) { - /* For internal errors, we generate E_ERROR, for direct calls an exception is thrown. - * The "scope" is determined by an opcode, if it is ZEND_FETCH_CLASS we know function was called indirectly by - * the Zend engine. - */ - zend_execute_data *ex = EX(prev_execute_data); - - while (ex && (!ex->func || !ZEND_USER_CODE(ex->func->type))) { - ex = ex->prev_execute_data; - } - if (ex && - ex->opline->opcode != ZEND_FETCH_CLASS && - ex->opline->opcode != ZEND_NEW) { - zend_throw_exception_ex(spl_ce_LogicException, 0, "Class %s could not be loaded", ZSTR_VAL(class_name)); - } else { - php_error_docref(NULL, E_ERROR, "Class %s could not be loaded", ZSTR_VAL(class_name)); - } - } } /* }}} */ /* {{{ proto string spl_autoload_extensions([string file_extensions]) |