X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=http_functions.c;h=cdddb81143d9ba91bb68227da1ac58674a510f2d;hb=c64365b84429b86b4af55b283de3758af38d9369;hp=4ece6965114f435e7312445828109f59fef155e0;hpb=ab7ffb9d04418a394dec4604f88a3aa5d94b9a08;p=m6w6%2Fext-http diff --git a/http_functions.c b/http_functions.c index 4ece696..cdddb81 100644 --- a/http_functions.c +++ b/http_functions.c @@ -12,17 +12,12 @@ /* $Id$ */ -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - +#define HTTP_WANT_SAPI #define HTTP_WANT_CURL #define HTTP_WANT_ZLIB #include "php_http.h" -#include "SAPI.h" #include "php_ini.h" -#include "ext/standard/info.h" #include "ext/standard/php_string.h" #include "zend_operators.h" @@ -46,8 +41,8 @@ * Compose a valid HTTP date regarding RFC 822/1123 * looking like: "Wed, 22 Dec 2004 11:34:47 GMT" * - * Takes an optional unix timestamp as parameter. - * + * Accepts an optional unix timestamp as parameter. + * * Returns the HTTP date as string. */ PHP_FUNCTION(http_date) @@ -59,7 +54,7 @@ PHP_FUNCTION(http_date) } if (t == -1) { - t = (long) time(NULL); + t = (long) HTTP_GET_REQUEST_TIME(); } RETURN_STRING(http_date(t), 0); @@ -376,7 +371,7 @@ PHP_FUNCTION(http_send_last_modified) } if (t == -1) { - t = (long) time(NULL); + t = (long) HTTP_GET_REQUEST_TIME(); } RETURN_SUCCESS(http_send_last_modified(t)); @@ -456,7 +451,7 @@ PHP_FUNCTION(http_match_modified) // current time if not supplied (senseless though) if (t == -1) { - t = (long) time(NULL); + t = (long) HTTP_GET_REQUEST_TIME(); } if (for_range) { @@ -524,7 +519,7 @@ PHP_FUNCTION(http_cache_last_modified) HTTP_CHECK_HEADERS_SENT(RETURN_FALSE); - t = (long) time(NULL); + t = (long) HTTP_GET_REQUEST_TIME(); /* 0 or omitted */ if (!last_modified) {