diff options
author | Rasmus Lerdorf <rasmus@php.net> | 2004-08-10 17:40:00 +0000 |
---|---|---|
committer | Rasmus Lerdorf <rasmus@php.net> | 2004-08-10 17:40:00 +0000 |
commit | cad60c3760b7c858b3280ad1f1b9ea9f4187c710 (patch) | |
tree | 89469c25e0b12dd8a59e7561f9338db4da0dd842 /sapi/apache/mod_php5.c | |
parent | 426443cc183a1a31b4fe70caa649ecac390e245a (diff) | |
download | php-git-cad60c3760b7c858b3280ad1f1b9ea9f4187c710.tar.gz |
Add SAPI hook to get the request time if provided by the web server,
otherwise call time(0) on the first call and store it so subsequent
calls will get the same time. Hook support for Apache1/2 included.
Diffstat (limited to 'sapi/apache/mod_php5.c')
-rw-r--r-- | sapi/apache/mod_php5.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/sapi/apache/mod_php5.c b/sapi/apache/mod_php5.c index 083cc8be56..ad2f3b3520 100644 --- a/sapi/apache/mod_php5.c +++ b/sapi/apache/mod_php5.c @@ -401,6 +401,14 @@ static int sapi_apache_get_target_gid(gid_t *obj TSRMLS_DC) } /* }}} */ +/* {{{ php_apache_get_request_time + */ +static time_t php_apache_get_request_time(TSRMLS_D) +{ + return ((request_rec *)SG(server_context))->request_time; +} +/* }}} */ + /* {{{ sapi_module_struct apache_sapi_module */ static sapi_module_struct apache_sapi_module = { @@ -429,6 +437,7 @@ static sapi_module_struct apache_sapi_module = { sapi_apache_register_server_variables, /* register server variables */ php_apache_log_message, /* Log message */ + php_apache_get_request_time, /* Get request time */ NULL, /* php.ini path override */ |