]> granicus.if.org Git - php/commitdiff
Add apache_child_terminate() and INI setting apache.child_terminate
authorSascha Schumann <sas@php.net>
Wed, 13 Dec 2000 13:19:56 +0000 (13:19 +0000)
committerSascha Schumann <sas@php.net>
Wed, 13 Dec 2000 13:19:56 +0000 (13:19 +0000)
which defaults to 0.

Submitted by: Sam Liddicott <sam.liddicott@ananova.com>

sapi/apache/mod_php4.h
sapi/apache/php_apache.c

index 461805550c91c4f16f71c4252ee5c7fa4728d3d4..ed9cdb776b6af589a32f6c3b7192275903c3b843 100644 (file)
@@ -30,6 +30,7 @@ typedef struct {
     long engine;
     long last_modified;
        long xbithack;
+       long terminate_child;
 } php_apache_info_struct;
 
 extern zend_module_entry apache_module_entry;
index 64898b8916450521ab155bbf275b1dbac1f765ce..8ead0de7709ac0f96ab34858494d71d082e28f6a 100644 (file)
@@ -67,6 +67,7 @@ PHP_FUNCTION(getallheaders);
 PHP_FUNCTION(apachelog);
 PHP_FUNCTION(apache_note);
 PHP_FUNCTION(apache_lookup_uri);
+PHP_FUNCTION(apache_child_terminate);
 
 PHP_MINFO_FUNCTION(apache);
 
@@ -75,6 +76,7 @@ function_entry apache_functions[] = {
        PHP_FE(getallheaders,                                                   NULL)
        PHP_FE(apache_note,                                                             NULL)
        PHP_FE(apache_lookup_uri,                                               NULL)
+       PHP_FE(apache_child_terminate,                                  NULL)
        {NULL, NULL, NULL}
 };
 
@@ -83,6 +85,7 @@ PHP_INI_BEGIN()
        STD_PHP_INI_ENTRY("xbithack",                   "0",                            PHP_INI_ALL,            OnUpdateInt,            xbithack, php_apache_info_struct, php_apache_info)
        STD_PHP_INI_ENTRY("engine",                             "1",                            PHP_INI_ALL,            OnUpdateInt,            engine, php_apache_info_struct, php_apache_info)
        STD_PHP_INI_ENTRY("last_modified",              "0",                            PHP_INI_ALL,            OnUpdateInt,            last_modified, php_apache_info_struct, php_apache_info)
+       STD_PHP_INI_ENTRY("child_terminate",    "0",                            PHP_INI_ALL,            OnUpdateInt,            terminate_child, php_apache_info_struct, php_apache_info)
 PHP_INI_END()
 
 
@@ -107,6 +110,20 @@ zend_module_entry apache_module_entry = {
        "apache", apache_functions, PHP_MINIT(apache), PHP_MSHUTDOWN(apache), NULL, NULL, PHP_MINFO(apache), STANDARD_MODULE_PROPERTIES
 };
 
+/* {{{ proto string child_terminate()
+   Get and set Apache request notes */
+PHP_FUNCTION(apache_child_terminate)
+{
+       APLS_FETCH();
+
+       if (AP(terminate_child)) {
+               ap_child_terminate( ((request_rec *)SG(server_context)) );
+       } else { /* tell them to get lost! */
+               php_error(E_WARNING, "apache.child_terminate is disabled");
+       }
+}
+/* }}} */
+
 /* {{{ proto string apache_note(string note_name [, string note_value])
    Get and set Apache request notes */
 PHP_FUNCTION(apache_note)