[PHP4BETA] CVS update: php4
| From: | zeev | Date: | Sun, 02 May 1999 19:54:02 +0000 |
| Subject: | [PHP4BETA] CVS update: php4 | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-626@lists.php.net to get a copy of this message | ||
Date: Sunday May 2, 1999 @ 15:54
Author: zeev
Update of /repository/php4
In directory php:/tmp/cvs-serv28231
Modified Files:
cgi_main.c fopen-wrappers.c main.c request_info.c
Log Message:
Move path_info to the SAPI structure
Index: php4/cgi_main.c
diff -u php4/cgi_main.c:1.5 php4/cgi_main.c:1.6
--- php4/cgi_main.c:1.5 Sun May 2 15:01:45 1999
+++ php4/cgi_main.c Sun May 2 15:54:01 1999
@@ -115,6 +115,13 @@
}
+static void init_request_info(SLS_D)
+{
+ SG(request_info).query_string = getenv("QUERY_STRING");
+ SG(request_info).request_uri = getenv("PATH_INFO");
+}
+
+
int main(int argc, char *argv[])
{
int cgi = 0, c, i, len;
@@ -293,7 +300,7 @@
php3_TreatHeaders();
- SG(request_info).query_string = getenv("QUERY_STRING");
+ init_request_info(SLS_C);
if (!cgi) {
if (!SG(request_info).query_string) {
Index: php4/fopen-wrappers.c
diff -u php4/fopen-wrappers.c:1.11 php4/fopen-wrappers.c:1.12
--- php4/fopen-wrappers.c:1.11 Mon Apr 26 10:00:46 1999
+++ php4/fopen-wrappers.c Sun May 2 15:54:01 1999
@@ -27,10 +27,11 @@
| Jim Winstead <jimw@php.net> |
+----------------------------------------------------------------------+
*/
-/* $Id: fopen-wrappers.c,v 1.11 1999/04/26 14:00:46 zeev Exp $ */
+/* $Id: fopen-wrappers.c,v 1.12 1999/05/02 19:54:01 zeev Exp $ */
#include "php.h"
#include "php_globals.h"
+#include "SAPI.h"
#include <stdio.h>
#include <stdlib.h>
@@ -205,9 +206,10 @@
char *temp, *path_info, *fn;
int l;
PLS_FETCH();
+ SLS_FETCH();
fn = request_info.filename;
- path_info = request_info.path_info;
+ path_info = SG(request_info).request_uri;
#if HAVE_PWD_H
if (PG(user_dir) && *PG(user_dir)
&& path_info && '/' == path_info[0] && '~' ==
path_info[1]) {
Index: php4/main.c
diff -u php4/main.c:1.42 php4/main.c:1.43
--- php4/main.c:1.42 Sun May 2 14:07:40 1999
+++ php4/main.c Sun May 2 15:54:01 1999
@@ -29,7 +29,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: main.c,v 1.42 1999/05/02 18:07:40 andi Exp $ */
+/* $Id: main.c,v 1.43 1999/05/02 19:54:01 zeev Exp $ */
#include <stdio.h>
@@ -1024,7 +1024,7 @@
/* Build the special-case PHP_SELF variable for the CGI version */
char *pi;
#if FORCE_CGI_REDIRECT
- pi = request_info.path_info;
+ pi = SG(request_info).request_uri;
tmp = (pval *) emalloc(sizeof(pval));
tmp->value.str.val = emalloc(((pi)?strlen(pi):0) + 1);
tmp->value.str.len = _php3_sprintf(tmp->value.str.val, "%s", (pi ? pi :
"")); /* SAFE */
@@ -1035,7 +1035,7 @@
int l = 0;
char *sn;
sn = request_info.script_name;
- pi = request_info.path_info;
+ pi = SG(request_info).request_uri;
if (sn)
l += strlen(sn);
if (pi)
Index: php4/request_info.c
diff -u php4/request_info.c:1.8 php4/request_info.c:1.9
--- php4/request_info.c:1.8 Sun May 2 15:31:56 1999
+++ php4/request_info.c Sun May 2 15:54:01 1999
@@ -40,7 +40,6 @@
char *buf; /* temporary buffers */
SLS_FETCH();
- request_info.path_info = getenv("PATH_INFO");
request_info.current_user = NULL;
request_info.current_user_length = 0;
request_info.request_method = getenv("REQUEST_METHOD");
@@ -120,27 +119,6 @@
return SUCCESS;
}
-#endif
-
-#if USE_SAPI
-/* temporary until I figure a beter way to do it */
-int php3_init_request_info(void *conf)
-{
- if (sapi_rqst->filename)
- request_info.filename = estrdup(sapi_rqst->filename);
- else
- request_info.filename = NULL;
- request_info.path_info = sapi_rqst->path_info;
- request_info.current_user = sapi_rqst->current_user;
- request_info.current_user_length = sapi_rqst->current_user_length;
- request_info.request_method = sapi_rqst->request_method;
- request_info.script_name = sapi_rqst->script_name;
- request_info.content_length = sapi_rqst->content_length;
- request_info.content_type = sapi_rqst->content_type;
- request_info.cookies = sapi_rqst->cookies;
-
- return SUCCESS;
-}
#endif
#if !CGI_BINARY
--
PHP 4 Beta