summaryrefslogtreecommitdiff
path: root/main/main.c
diff options
context:
space:
mode:
authorSam Ruby <rubys@php.net>1999-12-07 20:49:01 +0000
committerSam Ruby <rubys@php.net>1999-12-07 20:49:01 +0000
commit8abf7246780903b2b3084948dbe83e3b967d84bb (patch)
treea5e1168d097a3fb52b9e77b2f90e9fc2242aa28f /main/main.c
parent6068b5bdacc76296299ea9a3c9fa63049780d961 (diff)
downloadphp-git-8abf7246780903b2b3084948dbe83e3b967d84bb.tar.gz
Provide basis for shared libraries/dlls to contain internal extensions
Diffstat (limited to 'main/main.c')
-rw-r--r--main/main.c52
1 files changed, 50 insertions, 2 deletions
diff --git a/main/main.c b/main/main.c
index 08674d470a..f21d3563e7 100644
--- a/main/main.c
+++ b/main/main.c
@@ -854,6 +854,54 @@ static void core_globals_ctor(php_core_globals *core_globals)
#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;
@@ -934,8 +982,8 @@ int php_module_startup(sapi_module_struct *sf)
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;