cvs: /php4 request_info.c request_info.h /php4 SAPI.c SAPI.h main.c php.h safe_mode.c
| From: | Zeev Suraski | Date: | Thu, 10 Feb 2000 20:13:38 +0000 |
| Subject: | cvs: /php4 request_info.c request_info.h /php4 SAPI.c SAPI.h main.c php.h safe_mode.c | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-10063@lists.php.net to get a copy of this message | ||
zeev Thu Feb 10 12:13:38 2000 EDT
Removed files:
/php4 request_info.c request_info.h
Modified files:
/php4 SAPI.c SAPI.h main.c php.h safe_mode.c
Log:
request_info.c is dead! long live SAPI
@- Finished the server abstraction layer; All of the PHP code is now shared
@ across different servers (Apache, CGI, IIS, etc.), except for thin
@ interface modules (Zeev)
Index: php4/SAPI.c
diff -u php4/SAPI.c:1.50 php4/SAPI.c:1.51
--- php4/SAPI.c:1.50 Thu Feb 10 11:29:21 2000
+++ php4/SAPI.c Thu Feb 10 12:13:08 2000
@@ -12,7 +12,7 @@
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
- | Design: Shane Caraveo <shane@caraveo.com> |
+ | Original design: Shane Caraveo <shane@caraveo.com> |
| Authors: Andi Gutmans <andi@zend.com> |
| Zeev Suraski <zeev@zend.com> |
+----------------------------------------------------------------------+
@@ -176,6 +176,8 @@
SG(headers_sent) = 0;
SG(read_post_bytes) = 0;
SG(request_info).post_data = NULL;
+ SG(request_info).current_user = NULL;
+ SG(request_info).current_user_length = 0;
if (SG(request_info).request_method && !strcmp(SG(request_info).request_method,
"HEAD")) {
SG(request_info).headers_only = 1;
@@ -204,6 +206,9 @@
zend_llist_destroy(&SG(sapi_headers).headers);
if (SG(request_info).post_data) {
efree(SG(request_info).post_data);
+ }
+ if (SG(request_info).current_user) {
+ efree(SG(request_info).current_user);
}
if (sapi_module.deactivate) {
sapi_module.deactivate(SLS_C);
Index: php4/SAPI.h
diff -u php4/SAPI.h:1.35 php4/SAPI.h:1.36
--- php4/SAPI.h:1.35 Thu Feb 10 12:03:17 2000
+++ php4/SAPI.h Thu Feb 10 12:13:08 2000
@@ -79,6 +79,10 @@
/* this is necessary for the CGI SAPI module */
char *argv0;
+
+ /* this is necessary for Safe Mode */
+ char *current_user;
+ int current_user_length;
} sapi_request_info;
Index: php4/main.c
diff -u php4/main.c:1.200 php4/main.c:1.201
--- php4/main.c:1.200 Thu Feb 10 12:03:17 2000
+++ php4/main.c Thu Feb 10 12:13:08 2000
@@ -19,7 +19,7 @@
*/
-/* $Id: main.c,v 1.200 2000/02/10 20:03:17 zeev Exp $ */
+/* $Id: main.c,v 1.201 2000/02/10 20:13:08 zeev Exp $ */
#include <stdio.h>
@@ -625,11 +625,6 @@
/* initialize global variables */
PG(header_is_being_sent)=0;
-
- if (php_init_request_info(NULL)) {
- php_printf("Unable to initialize request info.\n");
- return FAILURE;
- }
zend_activate(CLS_C ELS_CC);
sapi_activate(SLS_C);
@@ -674,7 +669,6 @@
zend_deactivate(CLS_C ELS_CC);
sapi_deactivate(SLS_C);
- php_destroy_request_info(NULL);
shutdown_memory_manager(CG(unclean_shutdown), 0);
php_unset_timeout();
Index: php4/php.h
diff -u php4/php.h:1.60 php4/php.h:1.61
--- php4/php.h:1.60 Thu Feb 10 11:41:18 2000
+++ php4/php.h Thu Feb 10 12:13:08 2000
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php.h,v 1.60 2000/02/10 19:41:18 zeev Exp $ */
+/* $Id: php.h,v 1.61 2000/02/10 20:13:08 zeev Exp $ */
#ifndef _PHP_H
#define _PHP_H
@@ -113,8 +113,6 @@
#ifndef HAVE_SOCKLEN_T
typedef unsigned int socklen_t;
#endif
-
-#include "request_info.h"
#define CREATE_MUTEX(a,b)
#define SET_MUTEX(a)
Index: php4/safe_mode.c
diff -u php4/safe_mode.c:1.14 php4/safe_mode.c:1.15
--- php4/safe_mode.c:1.14 Thu Feb 10 10:19:02 2000
+++ php4/safe_mode.c Thu Feb 10 12:13:08 2000
@@ -15,7 +15,7 @@
| Authors: Rasmus Lerdorf <rasmus@lerdorf.on.ca> |
+----------------------------------------------------------------------+
*/
-/* $Id: safe_mode.c,v 1.14 2000/02/10 18:19:02 zeev Exp $ */
+/* $Id: safe_mode.c,v 1.15 2000/02/10 20:13:08 zeev Exp $ */
#include "php.h"
@@ -114,8 +114,8 @@
struct stat *pstat;
SLS_FETCH();
- if (request_info.current_user) {
- return request_info.current_user;
+ if (SG(request_info).current_user) {
+ return SG(request_info).current_user;
}
/* FIXME: I need to have this somehow handled if
@@ -131,8 +131,8 @@
if ((pwd=getpwuid(pstat->st_uid))==NULL) {
return empty_string;
}
- request_info.current_user_length = strlen(pwd->pw_name);
- request_info.current_user = estrndup(pwd->pw_name,request_info.current_user_length);
+ SG(request_info).current_user_length = strlen(pwd->pw_name);
+ SG(request_info).current_user = estrndup(pwd->pw_name, SG(request_info).current_user_length);
- return request_info.current_user;
+ return SG(request_info).current_user;
}