}
+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;
php3_TreatHeaders();
- SG(request_info).query_string = getenv("QUERY_STRING");
+ init_request_info(SLS_C);
if (!cgi) {
if (!SG(request_info).query_string) {
#else
sprintf(cgi_env_str, "CGI_REQUEST_METHOD=%s\nCGI_PATH_INFO=%s\nCGI_QUERY_STRING=%s",
request_info.request_method,
- request_info.path_info,
+ SG(request_info).request_uri,
SG(request_info).query_string);
#endif
/* !!!! memory for object and attributes is allocated with malloc !!!! */
#else
sprintf(cgi_env_str, "CGI_REQUEST_METHOD=%s\nCGI_PATH_INFO=%s\nCGI_QUERY_STRING=%s",
request_info.request_method,
- request_info.path_info,
+ SG(request_info).request_uri,
SG(request_info).query_string);
#endif
/* !!!! memory for object, bodytag and attributes is allocated with malloc !!!! */
#endif
ELS_FETCH();
PLS_FETCH();
+ SLS_FETCH();
#if WIN32|WINNT
// Get build numbers for Windows NT or Win95
PUTS("<img src=\"");
- /*PUTS(r->uri);*/
+ if (SG(request_info).request_uri) {
+ PUTS(SG(request_info).request_uri);
+ }
PUTS("?=PHPE9568F34-D428-11d2-A769-00AA001ACF42\" border=\"0\" width=\"100\" height=\"56\" align=\"right\">\n");
php3_printf("<center><h1>PHP Version %s</h1></center>\n", PHP_VERSION);
PUTS("<p>by <a href=\"mailto:rasmus@lerdorf.on.ca\">Rasmus Lerdorf</a>,\n");
PUTS("<table width=\"100%%\"><tr>\n");
php3_printf("<td><h2>Zend</h2>This program makes use of the Zend scripting language engine:<br><pre>%s</pre></td>", get_zend_version());
PUTS("<td width=\"100\"><a href=\"http://www.zend.com/\"><img src=\"");
- /*PUTS(r->uri);*/
+ if (SG(request_info).request_uri) {
+ PUTS(SG(request_info).request_uri);
+ }
PUTS("?=PHPE9568F35-D428-11d2-A769-00AA001ACF42\" border=\"0\" width=\"100\" height=\"89\"></a></td>\n");
PUTS("</tr></table>\n");
#include "php.h"
#include "php_globals.h"
+#include "SAPI.h"
#include <stdio.h>
#include <stdlib.h>
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]) {
/* 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 */
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)
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");
#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
int php3_destroy_request_info(void *conf)
{