mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Allow get_request_time() hook to fail
In particular, this allows using the hook without server_context. The apache2handler implementation now checks that server_context is available itself, as that's the implementation that cares about it.
This commit is contained in:
parent
13fa90fb55
commit
e2d05bfcb2
3 changed files with 10 additions and 6 deletions
|
@ -363,10 +363,15 @@ static void php_apache_sapi_log_message_ex(const char *msg, request_rec *r)
|
|||
}
|
||||
}
|
||||
|
||||
static double php_apache_sapi_get_request_time(void)
|
||||
static zend_result php_apache_sapi_get_request_time(double *request_time)
|
||||
{
|
||||
php_struct *ctx = SG(server_context);
|
||||
return ((double) ctx->r->request_time) / 1000000.0;
|
||||
if (!ctx) {
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
*request_time = ((double) ctx->r->request_time) / 1000000.0;
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
extern zend_module_entry php_apache_module;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue