From 3690ce39d9c775323ed73f41cb1a02fa56d19736 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Fri, 15 Oct 2010 07:30:24 +0000 Subject: [PATCH] zend_collect_module_handlers() has to be called after zend_extensions startup, because they can register additional 'hidden' extensions --- Zend/zend_API.c | 3 +-- Zend/zend_API.h | 1 + main/main.c | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Zend/zend_API.c b/Zend/zend_API.c index 7a021f7838..b89f8aaaa5 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -1688,7 +1688,7 @@ try_again: } /* }}} */ -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; } /* }}} */ diff --git a/Zend/zend_API.h b/Zend/zend_API.h index 220e1ac43f..1c81e30bab 100644 --- a/Zend/zend_API.h +++ b/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); diff --git a/main/main.c b/main/main.c index 56bc3a3b2c..d3edcdc1c5 100644 --- a/main/main.c +++ b/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) { -- 2.40.0