Skip to content

Commit 3690ce3

Browse files
committed
zend_collect_module_handlers() has to be called after zend_extensions startup, because they can register additional 'hidden' extensions
1 parent aaa2f1c commit 3690ce3

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

Zend/zend_API.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1688,7 +1688,7 @@ static void zend_sort_modules(void *base, size_t count, size_t siz, compare_func
16881688
}
16891689
/* }}} */
16901690

1691-
static void zend_collect_module_handlers(TSRMLS_D) /* {{{ */
1691+
ZEND_API void zend_collect_module_handlers(TSRMLS_D) /* {{{ */
16921692
{
16931693
HashPosition pos;
16941694
zend_module_entry *module;
@@ -1770,7 +1770,6 @@ ZEND_API int zend_startup_modules(TSRMLS_D) /* {{{ */
17701770
{
17711771
zend_hash_sort(&module_registry, zend_sort_modules, NULL, 0 TSRMLS_CC);
17721772
zend_hash_apply(&module_registry, (apply_func_t)zend_startup_module_ex TSRMLS_CC);
1773-
zend_collect_module_handlers(TSRMLS_C);
17741773
return SUCCESS;
17751774
}
17761775
/* }}} */

Zend/zend_API.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,7 @@ ZEND_API zend_module_entry* zend_register_internal_module(zend_module_entry *mod
260260
ZEND_API zend_module_entry* zend_register_module_ex(zend_module_entry *module TSRMLS_DC);
261261
ZEND_API int zend_startup_module_ex(zend_module_entry *module TSRMLS_DC);
262262
ZEND_API int zend_startup_modules(TSRMLS_D);
263+
ZEND_API void zend_collect_module_handlers(TSRMLS_D);
263264
ZEND_API void zend_destroy_modules(void);
264265
ZEND_API void zend_check_magic_method_implementation(const zend_class_entry *ce, const zend_function *fptr, int error_type TSRMLS_DC);
265266

main/main.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2059,6 +2059,8 @@ int php_module_startup(sapi_module_struct *sf, zend_module_entry *additional_mod
20592059
/* start Zend extensions */
20602060
zend_startup_extensions();
20612061

2062+
zend_collect_module_handlers(TSRMLS_C);
2063+
20622064
/* register additional functions */
20632065
if (sapi_module.additional_functions) {
20642066
if (zend_hash_find(&module_registry, "standard", sizeof("standard"), (void**)&module)==SUCCESS) {

0 commit comments

Comments
 (0)