rasmus Fri May 25 09:19:05 2007 UTC
Modified files:
/php-src/main SAPI.c
Log:
Optimize sapi_get_request_time() slightly making it use the cached time
and also checking if there is a server_context before trying to call
the request_time sapi hook.
http://cvs.php.net/viewvc.cgi/php-src/main/SAPI.c?r1=1.224&r2=1.225&diff_format=u
Index: php-src/main/SAPI.c
diff -u php-src/main/SAPI.c:1.224 php-src/main/SAPI.c:1.225
--- php-src/main/SAPI.c:1.224 Wed Apr 25 14:18:15 2007
+++ php-src/main/SAPI.c Fri May 25 09:19:05 2007
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: SAPI.c,v 1.224 2007/04/25 14:18:15 dmitry Exp $ */
+/* $Id: SAPI.c,v 1.225 2007/05/25 09:19:05 rasmus Exp $ */
#include <ctype.h>
#include <sys/stat.h>
@@ -920,12 +920,14 @@
SAPI_API time_t sapi_get_request_time(TSRMLS_D)
{
- if (sapi_module.get_request_time) {
- return sapi_module.get_request_time(TSRMLS_C);
+ if(SG(global_request_time)) return SG(global_request_time);
+
+ if (sapi_module.get_request_time && SG(server_context)) {
+ SG(global_request_time) =
sapi_module.get_request_time(TSRMLS_C);
} else {
- if(!SG(global_request_time)) SG(global_request_time) = time(0);
- return SG(global_request_time);
+ SG(global_request_time) = time(0);
}
+ return SG(global_request_time);
}
/*
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php