From 57a4a7ed3925f4f18a3cee5a7db99dbffb5acb82 Mon Sep 17 00:00:00 2001 From: Cliff Woolley Date: Fri, 17 May 2002 06:32:04 +0000 Subject: [PATCH] apache 2.0's apache_lookup_uri() was returning an array rather than an object, which contradicted both the documentation and the behavior of the same function under apache 1.3. PR: 14999 --- sapi/apache2filter/php_functions.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/sapi/apache2filter/php_functions.c b/sapi/apache2filter/php_functions.c index ed17f58b85..605e6de390 100644 --- a/sapi/apache2filter/php_functions.c +++ b/sapi/apache2filter/php_functions.c @@ -20,6 +20,7 @@ #include "SAPI.h" #include "apr_strings.h" +#include "apr_time.h" #include "ap_config.h" #include "util_filter.h" #include "httpd.h" @@ -69,9 +70,11 @@ PHP_FUNCTION(virtual) } #define ADD_LONG(name) \ - add_assoc_long(return_value, #name, rr->name) + add_property_long(return_value, #name, rr->name) +#define ADD_TIME(name) \ + add_property_long(return_value, #name, rr->name / APR_USEC_PER_SEC); #define ADD_STRING(name) \ - if (rr->name) add_assoc_string(return_value, #name, (char *) rr->name, 1) + if (rr->name) add_property_string(return_value, #name, (char *) rr->name, 1) PHP_FUNCTION(apache_lookup_uri) { @@ -82,13 +85,13 @@ PHP_FUNCTION(apache_lookup_uri) WRONG_PARAM_COUNT; if (rr->status == HTTP_OK) { - array_init(return_value); + object_init(return_value); ADD_LONG(status); ADD_STRING(the_request); ADD_STRING(status_line); ADD_STRING(method); - ADD_LONG(mtime); + ADD_TIME(mtime); ADD_LONG(clength); #if !MODULE_MAGIC_AT_LEAST(20020506,0) ADD_STRING(boundary); @@ -104,6 +107,12 @@ PHP_FUNCTION(apache_lookup_uri) ADD_STRING(filename); ADD_STRING(path_info); ADD_STRING(args); + ADD_LONG(allowed); + ADD_LONG(sent_bodyct); + ADD_LONG(bytes_sent); + ADD_LONG(request_time); + ADD_LONG(mtime); + ADD_TIME(request_time); ap_destroy_sub_req(rr); return; -- 2.40.0