summaryrefslogtreecommitdiff
path: root/sapi/apache/mod_php4.c
diff options
context:
space:
mode:
authorAndreas Karajannis <kara@php.net>2000-07-09 12:51:01 +0000
committerAndreas Karajannis <kara@php.net>2000-07-09 12:51:01 +0000
commit59604815e1133dc083d6a31a170599179fc2c2c5 (patch)
tree83ae602f172c3f1dd81159bbeb352e8f6ac56ae5 /sapi/apache/mod_php4.c
parentad271a2b33c4d92936a1dcdcd01472fd79607654 (diff)
downloadphp-git-59604815e1133dc083d6a31a170599179fc2c2c5.tar.gz
Fixed module / global shutdown for apache.
GSHUTDOWN functions are now executed and MSHUTDOWN functions are executed on child process exit
Diffstat (limited to 'sapi/apache/mod_php4.c')
-rw-r--r--sapi/apache/mod_php4.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/sapi/apache/mod_php4.c b/sapi/apache/mod_php4.c
index 6a4e28674c..4c1e37c046 100644
--- a/sapi/apache/mod_php4.c
+++ b/sapi/apache/mod_php4.c
@@ -77,6 +77,10 @@ int send_parsed_php_source(request_rec * r);
int php_xbithack_handler(request_rec * r);
void php_init_handler(server_rec *s, pool *p);
+#if MODULE_MAGIC_NUMBER >= 19970728
+void php_child_exit_handler(server_rec *s, pool *p);
+#endif
+
#if MODULE_MAGIC_NUMBER > 19961007
#define CONST_PREFIX const
#else
@@ -678,11 +682,30 @@ static void apache_php_module_shutdown_wrapper(void)
{
apache_php_initialized = 0;
sapi_module.shutdown(&sapi_module);
+
+#if MODULE_MAGIC_NUMBER >= 19970728
+ /* This function is only called on server exit if the apache API
+ * child_exit handler exists, so shutdown globally
+ */
+ sapi_shutdown();
+#endif
+
#ifdef ZTS
tsrm_shutdown();
#endif
}
+#if MODULE_MAGIC_NUMBER >= 19970728
+static void php_child_exit_handler(server_rec *s, pool *p)
+{
+/* apache_php_initialized = 0; */
+ sapi_module.shutdown(&sapi_module);
+
+#ifdef ZTS
+ tsrm_shutdown();
+#endif
+}
+#endif
void php_init_handler(server_rec *s, pool *p)
{
@@ -791,7 +814,7 @@ module MODULE_VAR_EXPORT php4_module =
,NULL /* child_init */
#endif
#if MODULE_MAGIC_NUMBER >= 19970728
- ,NULL /* child_exit */
+ ,php_child_exit_handler /* child_exit */
#endif
#if MODULE_MAGIC_NUMBER >= 19970902
,NULL /* post read-request */