@@ -1960,24 +1960,6 @@ int php_register_extensions(zend_module_entry * const * ptr, int count)
19601960 return SUCCESS ;
19611961}
19621962
1963- /* A very long time ago php_module_startup() was refactored in a way
1964- * which broke calling it with more than one additional module.
1965- * This alternative to php_register_extensions() works around that
1966- * by walking the shallower structure.
1967- *
1968- * See algo: https://bugs.php.net/bug.php?id=63159
1969- */
1970- static int php_register_extensions_bc (zend_module_entry * ptr , int count )
1971- {
1972- while (count -- ) {
1973- if (zend_register_internal_module (ptr ++ ) == NULL ) {
1974- return FAILURE ;
1975- }
1976- }
1977- return SUCCESS ;
1978- }
1979- /* }}} */
1980-
19811963#ifdef PHP_WIN32
19821964static _invalid_parameter_handler old_invalid_parameter_handler ;
19831965
@@ -2012,11 +1994,12 @@ void dummy_invalid_parameter_handler(
20121994#endif
20131995
20141996/* {{{ php_module_startup */
2015- int php_module_startup (sapi_module_struct * sf , zend_module_entry * additional_modules , uint32_t num_additional_modules )
1997+ zend_result php_module_startup (sapi_module_struct * sf , zend_module_entry * additional_module )
20161998{
20171999 zend_utility_functions zuf ;
20182000 zend_utility_values zuv ;
2019- int retval = SUCCESS , module_number = 0 ; /* for REGISTER_INI_ENTRIES() */
2001+ zend_result retval = SUCCESS ;
2002+ int module_number = 0 ; /* for REGISTER_INI_ENTRIES() */
20202003 char * php_os ;
20212004 zend_module_entry * module ;
20222005
@@ -2243,7 +2226,9 @@ int php_module_startup(sapi_module_struct *sf, zend_module_entry *additional_mod
22432226 }
22442227
22452228 /* start additional PHP extensions */
2246- php_register_extensions_bc (additional_modules , num_additional_modules );
2229+ if (additional_module && (zend_register_internal_module (additional_module ) == NULL )) {
2230+ return FAILURE ;
2231+ }
22472232
22482233 /* load and startup extensions compiled as shared objects (aka DLLs)
22492234 as requested by php.ini entries
@@ -2278,7 +2263,7 @@ int php_module_startup(sapi_module_struct *sf, zend_module_entry *additional_mod
22782263 module -> version = PHP_VERSION ;
22792264 module -> info_func = PHP_MINFO (php_core );
22802265 }
2281-
2266+
22822267 /* freeze the list of observer fcall_init handlers */
22832268 zend_observer_post_startup ();
22842269
0 commit comments