1
0
mirror of https://github.com/php/php-src.git synced 2026-03-31 04:32:19 +02:00

Merge branch 'PHP-5.5' into PHP-5.6

* PHP-5.5:
  Fix php_module_startup() when loading more than one additional module
This commit is contained in:
Sara Golemon
2013-12-03 18:21:12 -08:00

View File

@@ -1931,6 +1931,23 @@ int php_register_extensions(zend_module_entry **ptr, int count TSRMLS_DC)
}
return SUCCESS;
}
/* A very long time ago php_module_startup() was refactored in a way
* which broke calling it with more than one additional module.
* This alternative to php_register_extensions() works around that
* by walking the shallower structure.
*
* See algo: https://bugs.php.net/bug.php?id=63159
*/
static int php_register_extensions_bc(zend_module_entry *ptr, int count TSRMLS_DC)
{
while (count--) {
if (zend_register_internal_module(ptr++ TSRMLS_CC) == NULL) {
return FAILURE;
}
}
return SUCCESS;
}
/* }}} */
#if defined(PHP_WIN32) && _MSC_VER >= 1400
@@ -2201,7 +2218,7 @@ int php_module_startup(sapi_module_struct *sf, zend_module_entry *additional_mod
}
/* start additional PHP extensions */
php_register_extensions(&additional_modules, num_additional_modules TSRMLS_CC);
php_register_extensions_bc(additional_modules, num_additional_modules TSRMLS_CC);
/* load and startup extensions compiled as shared objects (aka DLLs)
as requested by php.ini entries