PHPAPI void php_module_shutdown_for_exec(void);
PHPAPI int php_module_shutdown_wrapper(sapi_module_struct *sapi_globals);
+PHPAPI int php_startup_extensions(zend_module_entry **ptr, int count);
+PHPAPI int php_global_startup_extensions(zend_module_entry **ptr, int count);
+PHPAPI int php_global_shutdown_extensions(zend_module_entry **ptr, int count);
+
PHPAPI void php_execute_script(zend_file_handle *primary_file CLS_DC ELS_DC PLS_DC);
extern void php_call_shutdown_functions(void);
sapi_globals_id = ts_allocate_id(sizeof(sapi_globals_struct), NULL, NULL);
#endif
- module_global_startup_modules();
+ php_global_startup_internal_extensions();
}
SAPI_API void sapi_shutdown(void)
{
- module_global_shutdown_modules();
+ php_global_shutdown_internal_extensions();
zend_hash_destroy(&known_post_content_types);
}
/* $Id$ */
#include "php.h"
+#include "main.h"
#include "modules.h"
#include "internal_functions_registry.h"
#include "zend_compile.h"
unsigned char second_arg_force_ref[] = { 2, BYREF_NONE, BYREF_FORCE };
unsigned char second_arg_allow_ref[] = { 2, BYREF_NONE, BYREF_ALLOW };
-zend_module_entry *php3_builtin_modules[] = {
+zend_module_entry *php_builtin_extensions[] = {
phpext_regex_ptr,
phpext_dl_ptr,
phpext_file_ptr,
@EXT_MODULE_PTRS@
};
+#define EXTCOUNT (sizeof(php_builtin_extensions)/sizeof(zend_module_entry *))
+
-int module_startup_modules(void)
+int php_startup_internal_extensions(void)
{
- zend_module_entry **ptr = php3_builtin_modules, **end = ptr+(sizeof(php3_builtin_modules)/sizeof(zend_module_entry *));
-
- while (ptr < end) {
- if (*ptr) {
- if (zend_startup_module(*ptr)==FAILURE) {
- return FAILURE;
- }
- }
- ptr++;
- }
- return SUCCESS;
+ return php_startup_extensions(php_builtin_extensions, EXTCOUNT);
}
-int module_global_startup_modules(void)
+int php_global_startup_internal_extensions(void)
{
- zend_module_entry **ptr = php3_builtin_modules, **end = ptr+(sizeof(php3_builtin_modules)/sizeof(zend_module_entry *));
-
- while (ptr < end) {
- if (*ptr) {
- if ((*ptr)->global_startup_func &&
- (*ptr)->global_startup_func()==FAILURE) {
- return FAILURE;
- }
- }
- ptr++;
- }
- return SUCCESS;
+ return php_global_startup_extensions(php_builtin_extensions, EXTCOUNT);
}
-int module_global_shutdown_modules(void)
+int php_global_shutdown_internal_extensions(void)
{
- zend_module_entry **ptr = php3_builtin_modules, **end = ptr+(sizeof(php3_builtin_modules)/sizeof(zend_module_entry *));
-
- while (ptr < end) {
- if (*ptr) {
- if ((*ptr)->global_shutdown_func &&
- (*ptr)->global_shutdown_func()==FAILURE) {
- return FAILURE;
- }
- }
- ptr++;
- }
- return SUCCESS;
+ return php_global_shutdown_extensions(php_builtin_extensions, EXTCOUNT);
}
/*
#include "php.h"
+#include "main.h"
#include "modules.h"
#include "internal_functions_registry.h"
#include "zend_compile.h"
unsigned char second_arg_force_ref[] = { 2, BYREF_NONE, BYREF_FORCE };
unsigned char second_arg_allow_ref[] = { 2, BYREF_NONE, BYREF_ALLOW };
-zend_module_entry *php3_builtin_modules[] = {
+zend_module_entry *php_builtin_extensions[] = {
phpext_dl_ptr,
phpext_file_ptr,
phpext_fsock_ptr,
phpext_assert_ptr
};
+#define EXTCOUNT (sizeof(php_builtin_extensions)/sizeof(zend_module_entry *))
+
-int module_startup_modules(void)
+int php_startup_internal_extensions(void)
{
- zend_module_entry **ptr = php3_builtin_modules, **end = ptr+(sizeof(php3_builtin_modules)/sizeof(zend_module_entry *));
-
- while (ptr < end) {
- if (*ptr) {
- if (zend_startup_module(*ptr)==FAILURE) {
- return FAILURE;
- }
- }
- ptr++;
- }
- return SUCCESS;
+ return php_startup_extensions(php_builtin_extensions, EXTCOUNT);
}
-int module_global_startup_modules(void)
+int php_global_startup_internal_extensions(void)
{
- zend_module_entry **ptr = php3_builtin_modules, **end = ptr+(sizeof(php3_builtin_modules)/sizeof(zend_module_entry *));
-
- while (ptr < end) {
- if (*ptr) {
- if ((*ptr)->global_startup_func &&
- (*ptr)->global_startup_func()==FAILURE) {
- return FAILURE;
- }
- }
- ptr++;
- }
- return SUCCESS;
+ return php_global_startup_extensions(php_builtin_extensions, EXTCOUNT);
}
-int module_global_shutdown_modules(void)
+int php_global_shutdown_internal_extensions(void)
{
- zend_module_entry **ptr = php3_builtin_modules, **end = ptr+(sizeof(php3_builtin_modules)/sizeof(zend_module_entry *));
-
- while (ptr < end) {
- if (*ptr) {
- if ((*ptr)->global_shutdown_func &&
- (*ptr)->global_shutdown_func()==FAILURE) {
- return FAILURE;
- }
- }
- ptr++;
- }
- return SUCCESS;
+ return php_global_shutdown_extensions(php_builtin_extensions, EXTCOUNT);
}
#endif
+int php_startup_extensions(zend_module_entry **ptr, int count)
+{
+ zend_module_entry **end = ptr+count;
+
+ while (ptr < end) {
+ if (*ptr) {
+ if (zend_startup_module(*ptr)==FAILURE) {
+ return FAILURE;
+ }
+ }
+ ptr++;
+ }
+ return SUCCESS;
+}
+
+int php_global_startup_extensions(zend_module_entry **ptr, int count)
+{
+ zend_module_entry **end = ptr+count;
+
+ while (ptr < end) {
+ if (*ptr) {
+ if ((*ptr)->global_startup_func &&
+ (*ptr)->global_startup_func()==FAILURE) {
+ return FAILURE;
+ }
+ }
+ ptr++;
+ }
+ return SUCCESS;
+}
+
+int php_global_shutdown_extensions(zend_module_entry **ptr, int count)
+{
+ zend_module_entry **end = ptr+count;
+
+ while (ptr < end) {
+ if (*ptr) {
+ if ((*ptr)->global_shutdown_func &&
+ (*ptr)->global_shutdown_func()==FAILURE) {
+ return FAILURE;
+ }
+ }
+ ptr++;
+ }
+ return SUCCESS;
+}
+
+
int php_module_startup(sapi_module_struct *sf)
{
zend_utility_functions zuf;
zend_set_utility_values(&zuv);
php_startup_SAPI_content_types();
- if (module_startup_modules() == FAILURE) {
- php_printf("Unable to start modules\n");
+ if (php_startup_internal_extensions() == FAILURE) {
+ php_printf("Unable to start builtin modules\n");
return FAILURE;
}
module_initialized = 1;
#define phpin zendin
/* functions */
-int module_startup_modules(void);
-int module_global_startup_modules(void);
-int module_global_shutdown_modules(void);
+int php_startup_internal_extensions(void);
+int php_global_startup_internal_extensions(void);
+int php_global_shutdown_internal_extensions(void);
int mergesort(void *base, size_t nmemb, register size_t size, int (*cmp) (const void *, const void *));