Bug #14999 Updated: apache_lookup_uri returning array for apache2 instead of object

From: Date: Mon, 18 Feb 2002 17:49:53 +0000
Subject: Bug #14999 Updated: apache_lookup_uri returning array for apache2 instead of object
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-511@lists.php.net to get a copy of this message
ID: 14999 Updated by: manu@php.net Reported By: pete@ana.sk Status: Open Bug Type: Apache2 related Operating System: linux PHP Version: 4.1.1 New Comment: What about this patch ? has someone try it ? what is the way of apache2 fonction ? keep the maximum of backwards compatibility ? Previous Comments: ------------------------------------------------------------------------ [2002-01-23 17:36:04] manu@php.net The Apache request_rec struct has many change between version 1.3 and 2.0. perhaps we should rename this fonction in apache2_lookup_uri for example the byterange has desapear here is the patch to be more compatible with apache 1.3 version PHP_FUNCTION(apache_lookup_uri) { pval **filename; request_rec *rr=NULL; rr = php_apache_lookup_uri(INTERNAL_FUNCTION_PARAM_PASSTHRU); if (!rr) WRONG_PARAM_COUNT; object_init(return_value); add_property_long(return_value,"status", rr->status); if (rr->the_request) { add_property_string(return_value,"the_request", rr->the_request, 1); } if (rr->status_line) { add_property_string(return_value,"status_line", (char *)rr->status_line, 1); } if (rr->method) { add_property_string(return_value,"method", (char *)rr->method, 1); } if (rr->content_type) { add_property_string(return_value,"content_type", (char *)rr->content_type, 1); } if (rr->handler) { add_property_string(return_value,"handler", (char *)rr->handler, 1); } if (rr->uri) { add_property_string(return_value,"uri", rr->uri, 1); } if (rr->filename) { add_property_string(return_value,"filename", rr->filename, 1); } if (rr->path_info) { add_property_string(return_value,"path_info", rr->path_info, 1); } if (rr->args) { add_property_string(return_value,"args", rr->args, 1); } if (rr->range) { add_property_string(return_value,"range",(char *)rr->range, 1); } if (rr->boundary) { add_property_string(return_value,"boundary",(char *)rr->boundary, 1); } add_property_long(return_value,"no_cache", rr->no_cache); add_property_long(return_value,"no_local_copy", rr->no_local_copy); add_property_long(return_value,"allowed", rr->allowed); add_property_long(return_value,"sent_bodyct", rr->sent_bodyct); add_property_long(return_value,"bytes_sent", rr->bytes_sent); add_property_long(return_value,"clength", rr->clength); #if MODULE_MAGIC_NUMBER >= 19980324 if (rr->unparsed_uri) { add_property_string(return_value,"unparsed_uri", rr->unparsed_uri, 1); } if(rr->mtime) { add_property_long(return_value,"mtime", rr->mtime); } #endif if(rr->request_time) { add_property_long(return_value,"request_time", rr->request_time); } ap_destroy_sub_req(rr); } ------------------------------------------------------------------------ [2002-01-11 12:59:34] pete@ana.sk this is simple: apache_lookup_uri is returning array on apache2 instead of object (as it is doing on apache 1.3 and as it is written in documentation). the array is filled good with right keys and values, only problem is that it is array and not object ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=14999&edit=1

« previous php.bugs (#511) next »