CVS update: php3/functions
| From: | rasmus | Date: | Tue, 01 Sep 1998 06:24:16 +0000 |
| Subject: | CVS update: php3/functions | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-703@lists.php.net to get a copy of this message | ||
Date: Tuesday September 1, 1998 @ 2:24
Author: rasmus
Update of /repository/php3/functions
In directory asf:/export/home/rasmus/php3/functions
Modified Files:
apache.c
Log Message:
Add apache_lookup_uri() function
Index: php3/functions/apache.c
diff -c php3/functions/apache.c:1.35 php3/functions/apache.c:1.36
*** php3/functions/apache.c:1.35 Tue Jul 14 10:37:16 1998
--- php3/functions/apache.c Tue Sep 1 02:24:16 1998
***************
*** 29,35 ****
+----------------------------------------------------------------------+
*/
! /* $Id: apache.c,v 1.35 1998/07/14 14:37:16 ssb Exp $ */
#ifdef THREAD_SAFE
#include "tls.h"
#endif
--- 29,35 ----
+----------------------------------------------------------------------+
*/
! /* $Id: apache.c,v 1.36 1998/09/01 06:24:16 rasmus Exp $ */
#ifdef THREAD_SAFE
#include "tls.h"
#endif
***************
*** 56,66 ****
--- 56,68 ----
void php3_apachelog(INTERNAL_FUNCTION_PARAMETERS);
void php3_info_apache(void);
void php3_apache_note(INTERNAL_FUNCTION_PARAMETERS);
+ void php3_apache_lookup_uri(INTERNAL_FUNCTION_PARAMETERS);
function_entry apache_functions[] = {
{"virtual", php3_virtual, NULL},
{"getallheaders", php3_getallheaders, NULL},
{"apache_note", php3_apache_note,NULL},
+ {"apache_lookup_uri", php3_apache_lookup_uri,NULL},
{NULL, NULL, NULL}
};
***************
*** 220,225 ****
--- 222,288 ----
}
}
}
+
+ void php3_apache_lookup_uri(INTERNAL_FUNCTION_PARAMETERS) {
+ pval *filename;
+ request_rec *rr=NULL;
+
+ if (ARG_COUNT(ht) != 1 || getParameters(ht,1,&filename) == FAILURE) {
+ WRONG_PARAM_COUNT;
+ }
+ convert_to_string(filename);
+
+ if(!(rr = ap_sub_req_lookup_uri(filename->value.str.val, GLOBAL(php3_rqst)))) {
+ php3_error(E_WARNING, "URI lookup failed", filename->value.str.val);
+ RETURN_FALSE;
+ }
+ 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",rr->status_line,1);
+ if(rr->method) add_property_string(return_value,"method",rr->method,1);
+ if(rr->content_type)
add_property_string(return_value,"content_type",rr->content_type,1);
+ if(rr->handler) add_property_string(return_value,"handler",rr->handler,1);
+ if(rr->unparsed_uri)
add_property_string(return_value,"unparsed_uri",rr->unparsed_uri,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->args) add_property_string(return_value,"args",rr->args,1);
+ if(rr->boundary) add_property_string(return_value,"boundary",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,"byterange",rr->byterange);
+ add_property_long(return_value,"clength",rr->clength);
+ if(rr->mtime) add_property_long(return_value,"mtime",rr->mtime);
+ if(rr->request_time)
add_property_long(return_value,"request_time",rr->request_time);
+
+ ap_destroy_sub_req(rr);
+ }
+
+ #if 0
+ This function is most likely a bad idea. Just playing with it for now.
+
+ void php3_apache_exec_uri(INTERNAL_FUNCTION_PARAMETERS) {
+ pval *filename;
+ request_rec *rr=NULL;
+
+ if (ARG_COUNT(ht) != 1 || getParameters(ht,1,&filename) == FAILURE) {
+ WRONG_PARAM_COUNT;
+ }
+ convert_to_string(filename);
+
+ if(!(rr = ap_sub_req_lookup_uri(filename->value.str.val, GLOBAL(php3_rqst)))) {
+ php3_error(E_WARNING, "URI lookup failed", filename->value.str.val);
+ RETURN_FALSE;
+ }
+ RETVAL_LONG(ap_run_sub_req(rr));
+ ap_destroy_sub_req(rr);
+ }
+ #endif
#endif
--
PHP Development Mailing List http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net
For help: php-dev-help@lists.php.net