rasmus          Fri May 25 09:12:35 2007 UTC

  Modified files:              (Branch: PHP_5_2)
    /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.202.2.7.2.13&r2=1.202.2.7.2.14&diff_format=u
Index: php-src/main/SAPI.c
diff -u php-src/main/SAPI.c:1.202.2.7.2.13 php-src/main/SAPI.c:1.202.2.7.2.14
--- php-src/main/SAPI.c:1.202.2.7.2.13  Wed Apr 25 14:18:01 2007
+++ php-src/main/SAPI.c Fri May 25 09:12:35 2007
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: SAPI.c,v 1.202.2.7.2.13 2007/04/25 14:18:01 dmitry Exp $ */
+/* $Id: SAPI.c,v 1.202.2.7.2.14 2007/05/25 09:12:35 rasmus Exp $ */
 
 #include <ctype.h>
 #include <sys/stat.h>
@@ -986,12 +986,14 @@
 
 SAPI_API time_t sapi_get_request_time(TSRMLS_D)
 {
+       if(SG(global_request_time)) return SG(global_request_time);
+
        if (sapi_module.get_request_time) {
-               return sapi_module.get_request_time(TSRMLS_C);
+               SG(global_request_time) = 
(SG(server_context))?sapi_module.get_request_time(TSRMLS_C):time(0);
        } 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

Reply via email to