Permalink
Browse files

zend_collect_module_handlers() has to be called after zend_extensions…

… startup, because they can register additional 'hidden' extensions
  • Loading branch information...
1 parent aaa2f1c commit 3690ce39d9c775323ed73f41cb1a02fa56d19736 Dmitry Stogov committed Oct 15, 2010
Showing with 4 additions and 2 deletions.
  1. +1 −2 Zend/zend_API.c
  2. +1 −0 Zend/zend_API.h
  3. +2 −0 main/main.c
View
3 Zend/zend_API.c
@@ -1688,7 +1688,7 @@ static void zend_sort_modules(void *base, size_t count, size_t siz, compare_func
}
/* }}} */
-static void zend_collect_module_handlers(TSRMLS_D) /* {{{ */
+ZEND_API void zend_collect_module_handlers(TSRMLS_D) /* {{{ */
{
HashPosition pos;
zend_module_entry *module;
@@ -1770,7 +1770,6 @@ ZEND_API int zend_startup_modules(TSRMLS_D) /* {{{ */
{
zend_hash_sort(&module_registry, zend_sort_modules, NULL, 0 TSRMLS_CC);
zend_hash_apply(&module_registry, (apply_func_t)zend_startup_module_ex TSRMLS_CC);
- zend_collect_module_handlers(TSRMLS_C);
return SUCCESS;
}
/* }}} */
View
1 Zend/zend_API.h
@@ -260,6 +260,7 @@ ZEND_API zend_module_entry* zend_register_internal_module(zend_module_entry *mod
ZEND_API zend_module_entry* zend_register_module_ex(zend_module_entry *module TSRMLS_DC);
ZEND_API int zend_startup_module_ex(zend_module_entry *module TSRMLS_DC);
ZEND_API int zend_startup_modules(TSRMLS_D);
+ZEND_API void zend_collect_module_handlers(TSRMLS_D);
ZEND_API void zend_destroy_modules(void);
ZEND_API void zend_check_magic_method_implementation(const zend_class_entry *ce, const zend_function *fptr, int error_type TSRMLS_DC);
View
2 main/main.c
@@ -2059,6 +2059,8 @@ int php_module_startup(sapi_module_struct *sf, zend_module_entry *additional_mod
/* start Zend extensions */
zend_startup_extensions();
+ zend_collect_module_handlers(TSRMLS_C);
+
/* register additional functions */
if (sapi_module.additional_functions) {
if (zend_hash_find(&module_registry, "standard", sizeof("standard"), (void**)&module)==SUCCESS) {

0 comments on commit 3690ce3

Please sign in to comment.