[PHP4BETA] CVS update: php4/ext/apache

From: Date: Mon, 26 Apr 1999 17:26:34 +0000
Subject: [PHP4BETA] CVS update: php4/ext/apache
Groups: php.version4 
Request: Send a blank email to php-version4+get-555@lists.php.net to get a copy of this message
Date: Monday April 26, 1999 @ 13:26 Author: zeev Update of /repository/php4/ext/apache In directory php:/tmp/cvs-serv18494/ext/apache Modified Files: apache.c Log Message: * Get the Apache module to compile again * Get rid of php3_rqst, use SG(server_context) instead (there's still Apache-specific code, but it nuked a global) Index: php4/ext/apache/apache.c diff -u php4/ext/apache/apache.c:1.4 php4/ext/apache/apache.c:1.5 --- php4/ext/apache/apache.c:1.4 Fri Apr 23 20:11:50 1999 +++ php4/ext/apache/apache.c Mon Apr 26 13:26:33 1999 @@ -29,11 +29,12 @@ +----------------------------------------------------------------------+ */ -/* $Id: apache.c,v 1.4 1999/04/24 00:11:50 zeev Exp $ */ +/* $Id: apache.c,v 1.5 1999/04/26 17:26:33 zeev Exp $ */ #include "php.h" #include "ext/standard/head.h" #include "php_globals.h" #include "php_ini.h" +#include "SAPI.h" #include "mod_php3.h" #include <stdlib.h> @@ -130,6 +131,7 @@ pval *arg_name,*arg_val; char *note_val; int arg_count = ARG_COUNT(ht); + SLS_FETCH(); if (arg_count<1 || arg_count>2 || getParameters(ht,arg_count,&arg_name,&arg_val) == FAILURE ) { @@ -137,11 +139,11 @@ } convert_to_string(arg_name); - note_val = (char *) table_get(php3_rqst->notes,arg_name->value.str.val); + note_val = (char *) table_get(((request_rec *) SG(server_context))->notes,arg_name->value.str.val); if (arg_count == 2) { convert_to_string(arg_val); - table_set(php3_rqst->notes,arg_name->value.str.val,arg_val->value.str.val); + table_set(((request_rec *) SG(server_context))->notes,arg_name->value.str.val,arg_val->value.str.val); } if (note_val) { @@ -158,13 +160,16 @@ char name[64]; char *p; #endif - server_rec *serv = php3_rqst->server; + server_rec *serv; extern char server_root[MAX_STRING_LEN]; extern uid_t user_id; extern char *user_name; extern gid_t group_id; extern int max_requests_per_child; + SLS_FETCH(); + serv = ((request_rec *) SG(server_context))->server; + #if WIN32|WINNT PUTS("Apache for Windows 95/NT<br>"); #else @@ -214,13 +219,14 @@ { pval *filename; request_rec *rr = NULL; + SLS_FETCH(); if (ARG_COUNT(ht) != 1 || getParameters(ht,1,&filename) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_string(filename); - if (!(rr = sub_req_lookup_uri (filename->value.str.val, php3_rqst))) { + if (!(rr = sub_req_lookup_uri (filename->value.str.val, ((request_rec *) SG(server_context))))) { php3_error(E_WARNING, "Unable to include '%s' - URI lookup failed", filename->value.str.val); if (rr) destroy_sub_req (rr); RETURN_FALSE; @@ -259,11 +265,12 @@ array_header *env_arr; table_entry *tenv; int i; + SLS_FETCH(); if (array_init(return_value) == FAILURE) { RETURN_FALSE; } - env_arr = table_elts(php3_rqst->headers_in); + env_arr = table_elts(((request_rec *) SG(server_context))->headers_in); tenv = (table_entry *)env_arr->elts; for (i = 0; i < env_arr->nelts; ++i) { if (!tenv[i].key || @@ -284,13 +291,14 @@ { pval *filename; request_rec *rr=NULL; + SLS_FETCH(); if (ARG_COUNT(ht) != 1 || getParameters(ht,1,&filename) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_string(filename); - if(!(rr = sub_req_lookup_uri(filename->value.str.val, php3_rqst))) { + if(!(rr = sub_req_lookup_uri(filename->value.str.val, ((request_rec *) SG(server_context))))) { php3_error(E_WARNING, "URI lookup failed", filename->value.str.val); RETURN_FALSE; } @@ -353,16 +361,18 @@ #if 0 This function is most likely a bad idea. Just playing with it for now. -void php3_apache_exec_uri(INTERNAL_FUNCTION_PARAMETERS) { +void php3_apache_exec_uri(INTERNAL_FUNCTION_PARAMETERS) +{ pval *filename; request_rec *rr=NULL; + SLS_FETCH(); 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, php3_rqst))) { + if(!(rr = ap_sub_req_lookup_uri(filename->value.str.val, ((request_rec *) SG(server_context))))) { php3_error(E_WARNING, "URI lookup failed", filename->value.str.val); RETURN_FALSE; } -- PHP 4 Beta

« previous php.version4 (#555) next »