Date: 01/29/00
- Next message: Rasmus Lerdorf: "[PHP4BETA] cvs: /php4/sapi/apache mod_php4.c"
- Previous message: Mikkel Staunsholm: "[PHP4BETA] win32 compile"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
zeev Sat Jan 29 03:56:15 2000 EDT
Modified files:
/php4 main.c php_variables.c php_variables.h rfc1867.c
/php4/sapi/apache mod_php4.c
/php4/sapi/cgi cgi_main.c
/php4/sapi/isapi php4isapi.c
Log:
- Change the argument order of php_register_variable() to something more
intuitive.
- Make the authentication variables be a part of the HTTP_SERVER_VARS[] array
Index: php4/main.c
diff -u php4/main.c:1.186 php4/main.c:1.187
--- php4/main.c:1.186 Fri Jan 28 10:29:37 2000
+++ php4/main.c Sat Jan 29 03:55:43 2000
@@ -19,7 +19,7 @@
*/
-/* $Id: main.c,v 1.186 2000/01/28 18:29:37 zeev Exp $ */
+/* $Id: main.c,v 1.187 2000/01/29 11:55:43 zeev Exp $ */
#include <stdio.h>
@@ -702,13 +702,6 @@
} else if (PG(implicit_flush)) {
php_start_implicit_flush();
}
-
- if (SG(request_info).auth_user) {
- php_register_variable(SG(request_info).auth_user, "PHP_AUTH_USER", NULL ELS_CC PLS_CC);
- }
- if (SG(request_info).auth_password) {
- php_register_variable(SG(request_info).auth_password, "PHP_AUTH_PW", NULL ELS_CC PLS_CC);
- }
return SUCCESS;
}
@@ -1006,11 +999,24 @@
array_init(array_ptr);
INIT_PZVAL(array_ptr);
zend_hash_add(&EG(symbol_table), "HTTP_SERVER_VARS", sizeof("HTTP_SERVER_VARS"), &array_ptr, sizeof(pval *),NULL);
+ }
+
+ /* Server variables */
+ if (sapi_module.register_server_variables) {
+ sapi_module.register_server_variables(array_ptr ELS_CC SLS_CC PLS_CC);
}
- sapi_module.register_server_variables(array_ptr ELS_CC SLS_CC PLS_CC);
+ /* argv/argc support */
if (PG(register_argc_argv)) {
php_build_argv(SG(request_info).query_string, array_ptr ELS_CC PLS_CC);
+ }
+
+ /* PHP Authentication support */
+ if (SG(request_info).auth_user) {
+ php_register_variable("PHP_AUTH_USER", SG(request_info).auth_user, array_ptr ELS_CC PLS_CC);
+ }
+ if (SG(request_info).auth_password) {
+ php_register_variable("PHP_AUTH_PW", SG(request_info).auth_password, array_ptr ELS_CC PLS_CC);
}
}
Index: php4/php_variables.c
diff -u php4/php_variables.c:1.2 php4/php_variables.c:1.3
--- php4/php_variables.c:1.2 Fri Jan 28 10:29:37 2000
+++ php4/php_variables.c Sat Jan 29 03:55:43 2000
@@ -28,7 +28,7 @@
#include "zend_globals.h"
-PHPAPI void php_register_variable(char *val, char *var, pval *track_vars_array ELS_DC PLS_DC)
+PHPAPI void php_register_variable(char *var, char *val, pval *track_vars_array ELS_DC PLS_DC)
{
char *p = NULL;
char *ip; /* index pointer */
@@ -265,7 +265,7 @@
/* FIXME: XXX: not binary safe, discards returned length */
php_url_decode(var, strlen(var));
php_url_decode(val, strlen(val));
- php_register_variable(val, var, array_ptr ELS_CC PLS_CC);
+ php_register_variable(var, val, array_ptr ELS_CC PLS_CC);
}
if (arg == PARSE_COOKIE) {
var = strtok_r(NULL, ";", &strtok_buf);
@@ -303,7 +303,7 @@
continue;
}
t = estrndup(*env, p - *env);
- php_register_variable(p+1, t, array_ptr ELS_CC PLS_CC);
+ php_register_variable(t, p+1, array_ptr ELS_CC PLS_CC);
efree(t);
}
}
Index: php4/php_variables.h
diff -u php4/php_variables.h:1.1 php4/php_variables.h:1.2
--- php4/php_variables.h:1.1 Fri Jan 28 09:24:49 2000
+++ php4/php_variables.h Sat Jan 29 03:55:43 2000
@@ -27,7 +27,7 @@
| Zeev Suraski <zeev <email protected>> |
+----------------------------------------------------------------------+
*/
-/* $Id: php_variables.h,v 1.1 2000/01/28 17:24:49 zeev Exp $ */
+/* $Id: php_variables.h,v 1.2 2000/01/29 11:55:43 zeev Exp $ */
#ifndef _PHP_VARIABLES_H
#define _PHP_VARIABLES_H
@@ -42,6 +42,6 @@
void php_treat_data(int arg, char *str ELS_DC PLS_DC SLS_DC);
void php_import_environment_variables(ELS_D PLS_DC);
-PHPAPI void php_register_variable(char *val, char *var, pval *track_vars_array ELS_DC PLS_DC);
+PHPAPI void php_register_variable(char *var, char *val, pval *track_vars_array ELS_DC PLS_DC);
#endif /* _PHP_VARIABLES_H */
Index: php4/rfc1867.c
diff -u php4/rfc1867.c:1.23 php4/rfc1867.c:1.24
--- php4/rfc1867.c:1.23 Fri Jan 28 09:24:49 2000
+++ php4/rfc1867.c Sat Jan 29 03:55:43 2000
@@ -15,7 +15,7 @@
| Authors: Rasmus Lerdorf <rasmus <email protected>> |
+----------------------------------------------------------------------+
*/
-/* $Id: rfc1867.c,v 1.23 2000/01/28 17:24:49 zeev Exp $ */
+/* $Id: rfc1867.c,v 1.24 2000/01/29 11:55:43 zeev Exp $ */
#include <stdio.h>
#include "php.h"
@@ -157,7 +157,7 @@
*(loc - 4) = '\0';
/* Magic function that figures everything out */
- php_register_variable(ptr,namebuf,http_post_vars ELS_CC PLS_CC);
+ php_register_variable(namebuf, ptr, http_post_vars ELS_CC PLS_CC);
/* And a little kludge to pick out special MAX_FILE_SIZE */
itype = php_check_ident_type(namebuf);
Index: php4/sapi/apache/mod_php4.c
diff -u php4/sapi/apache/mod_php4.c:1.15 php4/sapi/apache/mod_php4.c:1.16
--- php4/sapi/apache/mod_php4.c:1.15 Fri Jan 28 09:38:08 2000
+++ php4/sapi/apache/mod_php4.c Sat Jan 29 03:55:43 2000
@@ -17,7 +17,7 @@
| PHP 4.0 patches by Zeev Suraski <zeev <email protected>> |
+----------------------------------------------------------------------+
*/
-/* $Id: mod_php4.c,v 1.15 2000/01/28 17:38:08 zeev Exp $ */
+/* $Id: mod_php4.c,v 1.16 2000/01/29 11:55:43 zeev Exp $ */
#include "zend.h"
#include "php.h"
@@ -245,14 +245,14 @@
} else {
val = empty_string;
}
- php_register_variable(val, elts[i].key, NULL ELS_CC PLS_CC);
+ php_register_variable(elts[i].key, val, NULL ELS_CC PLS_CC);
}
/* insert special variables */
if (script_filename) {
- php_register_variable(script_filename, "PATH_TRANSLATED", NULL ELS_CC PLS_CC);
+ php_register_variable("PATH_TRANSLATED", script_filename, NULL ELS_CC PLS_CC);
}
- php_register_variable(((request_rec *) SG(server_context))->uri, "PHP_SELF", NULL ELS_CC PLS_CC);
+ php_register_variable("PHP_SELF", ((request_rec *) SG(server_context))->uri, NULL ELS_CC PLS_CC);
}
Index: php4/sapi/cgi/cgi_main.c
diff -u php4/sapi/cgi/cgi_main.c:1.17 php4/sapi/cgi/cgi_main.c:1.18
--- php4/sapi/cgi/cgi_main.c:1.17 Fri Jan 28 10:29:37 2000
+++ php4/sapi/cgi/cgi_main.c Sat Jan 29 03:55:44 2000
@@ -133,7 +133,7 @@
/* Build the special-case PHP_SELF variable for the CGI version */
#if FORCE_CGI_REDIRECT
- php_register_variable((SG(request_info).request_uri ? SG(request_info).request_uri, "PHP_SELF", track_vars_array ELS_CC PLS_CC);
+ php_register_variable("PHP_SELF", (SG(request_info).request_uri ? SG(request_info).request_uri, track_vars_array ELS_CC PLS_CC);
#else
{
char *sn;
@@ -152,7 +152,7 @@
}
val = emalloc(l + 1);
php_sprintf(val, "%s%s", (sn ? sn : ""), (pi ? pi : "")); /* SAFE */
- php_register_variable(val, "PHP_SELF", track_vars_array ELS_CC PLS_CC);
+ php_register_variable("PHP_SELF", val, track_vars_array ELS_CC PLS_CC);
efree(val);
}
#endif
Index: php4/sapi/isapi/php4isapi.c
diff -u php4/sapi/isapi/php4isapi.c:1.12 php4/sapi/isapi/php4isapi.c:1.13
--- php4/sapi/isapi/php4isapi.c:1.12 Fri Jan 28 09:24:51 2000
+++ php4/sapi/isapi/php4isapi.c Sat Jan 29 03:55:44 2000
@@ -328,7 +328,7 @@
value++;
}
*colon = 0;
- php_register_variable(value, variable, track_vars_array ELS_CC PLS_CC);
+ php_register_variable(variable, value, track_vars_array ELS_CC PLS_CC);
*colon = ':';
}
variable = strtok_r(NULL, "\r\n", &strtok_buf);
-- PHP 4.0 Beta Mailing List <http://www.php.net/version4/> To unsubscribe, e-mail: php4beta-unsubscribe <email protected> For additional commands, e-mail: php4beta-help <email protected> To contact the list administrators, e-mail: php4beta-admin <email protected>
- Next message: Rasmus Lerdorf: "[PHP4BETA] cvs: /php4/sapi/apache mod_php4.c"
- Previous message: Mikkel Staunsholm: "[PHP4BETA] win32 compile"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

