summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRasmus Lerdorf <rasmus@php.net>2001-09-06 23:39:02 +0000
committerRasmus Lerdorf <rasmus@php.net>2001-09-06 23:39:02 +0000
commit15611c1885ab015705700fe0bc22349825dde727 (patch)
tree674c9e29a4c8ab27f4d27c794f63b9754fecbaf1
parent2797cf132390f2efc5e70013bca793230dbd1adb (diff)
downloadphp-git-15611c1885ab015705700fe0bc22349825dde727.tar.gz
Ok, get it onto the right branch
(cvs can get annoying sometimes)
-rw-r--r--sapi/apache/sapi_apache.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/sapi/apache/sapi_apache.c b/sapi/apache/sapi_apache.c
index 572d46ebff..0599863241 100644
--- a/sapi/apache/sapi_apache.c
+++ b/sapi/apache/sapi_apache.c
@@ -100,6 +100,40 @@ int apache_php_module_main(request_rec *r, int display_source_mode TSRMLS_DC)
}
/* }}} */
+/* {{{ apache_php_module_hook
+ */
+int apache_php_module_hook(request_rec *r, char *filename, zval **ret TSRMLS_DC)
+{
+ zend_file_handle file_handle;
+
+#if PHP_SIGCHILD
+ signal(SIGCHLD, sigchld_handler);
+#endif
+
+ if (php_request_startup_for_hook(TSRMLS_C) == FAILURE) {
+ return FAILURE;
+ }
+
+ /* Add PHP_SELF_HOOK - Absolute path */
+ php_register_variable("PHP_SELF_HOOK", filename, PG(http_globals)[TRACK_VARS_SERVER] TSRMLS_CC);
+
+ file_handle.type = ZEND_HANDLE_FILENAME;
+ file_handle.handle.fd = 0;
+ file_handle.filename = filename;
+ file_handle.opened_path = NULL;
+ file_handle.free_filename = 0;
+
+ (void) php_execute_simple_script(&file_handle, ret TSRMLS_CC);
+
+ AP(in_request) = 0;
+
+ zend_try {
+ php_request_shutdown_for_hook(NULL);
+ } zend_end_try();
+
+ return (OK);
+}
+
/*
* Local variables:
* tab-width: 4