]> granicus.if.org Git - php/commitdiff
apache 2.0's apache_lookup_uri() was returning an array rather than an
authorCliff Woolley <jwoolley@php.net>
Fri, 17 May 2002 06:32:04 +0000 (06:32 +0000)
committerCliff Woolley <jwoolley@php.net>
Fri, 17 May 2002 06:32:04 +0000 (06:32 +0000)
object, which contradicted both the documentation and the behavior of the
same function under apache 1.3.

PR: 14999

sapi/apache2filter/php_functions.c

index ed17f58b857460cc5b1ee7337a4e24046450679b..605e6de3901be668c40ddca4c4970565708ec8d5 100644 (file)
@@ -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;