CVS update: php31/sapi
| From: | shane | Date: | Fri, 14 Aug 1998 17:48:57 +0000 |
| Subject: | CVS update: php31/sapi | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-234@lists.php.net to get a copy of this message | ||
Date: Friday August 14, 1998 @ 13:48
Author: shane
Update of /repository/php31/sapi
In directory asf:/tmp/cvs-serv1644/sapi
Modified Files:
cgi_sapi.c
Log Message:
some logic cleanup in getting cgi filename
Index: php31/sapi/cgi_sapi.c
diff -c php31/sapi/cgi_sapi.c:2.4 php31/sapi/cgi_sapi.c:2.5
*** php31/sapi/cgi_sapi.c:2.4 Fri Aug 14 12:41:52 1998
--- php31/sapi/cgi_sapi.c Fri Aug 14 13:48:56 1998
***************
*** 226,268 ****
sapi_info->debug_log=sapi_debug_log;
#endif
! /* Hack for annoying servers that do not set SCRIPT_FILENAME for us */
! if (!sapi_info->script_filename) {
! sapi_info->script_filename = sapi_info->argv0;
! }
! #if WIN32|WINNT
! /* FIXME WHEN APACHE NT IS FIXED */
! /* a hack for apache nt because it does not appear to set argv[1] and sets
! script filename to php.exe thus makes us parse php.exe instead of file.php
! requires we get the info from path translated. This can be removed at
! such a time taht apache nt is fixed */
! else if (sapi_info->path_translated) {
! sapi_info->script_filename = strdup(sapi_info->path_translated);
! } else if(!sapi_info->script_filename){
! sapi_info->script_filename = NULL;
}
- #endif
-
- /* doc_root configuration variable is currently ignored,
- as it is with every other access method currently also. */
- /* We always need to emalloc() filename, since it gets placed into
- the include file hash table, and gets freed with that table.
- Notice that this means that we don't need to efree() it in
- php3_destroy_request_info()! */
- #if DISCARD_PATH
if (sapi_info->script_filename) {
sapi_info->rqst_filename = strdup(sapi_info->script_filename);
} else {
sapi_info->rqst_filename = NULL;
}
- #else
- if (sapi_info->path_translated) {
- sapi_info->rqst_filename = strdup(sapi_info->path_translated);
- } else {
- sapi_info->rqst_filename = NULL;
- }
- #endif
}
void sapi_end(void){
--- 226,251 ----
sapi_info->debug_log=sapi_debug_log;
#endif
! /* Hack for annoying servers that do not set SCRIPT_FILENAME for us
! (like anything other than apache? :)*/
! if(!sapi_info->script_filename){
! if (sapi_info->argv0) {
! sapi_info->script_filename = sapi_info->argv0;
! }else if (sapi_info->path_translated) {
! /*for broken servers that don't set argv correctly,
! not the best thing, but works*/
! sapi_info->script_filename = strdup(sapi_info->path_translated);
! } else {
! /*hmm, no file specified, we could just exit with error now*/
! sapi_info->script_filename = NULL;
! }
}
if (sapi_info->script_filename) {
sapi_info->rqst_filename = strdup(sapi_info->script_filename);
} else {
sapi_info->rqst_filename = NULL;
}
}
void sapi_end(void){
***************
*** 325,333 ****
sapi_info->info_only=0;
sapi_info->display_source_mode = 0;
sapi_info->rqst_filename=NULL;
sapi_info->filename=NULL;
sapi_info->query_string=NULL;
- // sapi_info->server_string=&server_string;
/* Make sure we detect we are a cgi - a bit redundancy here,
but the default case is that we have to check only the first one. */
--- 308,316 ----
sapi_info->info_only=0;
sapi_info->display_source_mode = 0;
sapi_info->rqst_filename=NULL;
+ sapi_info->script_filename=NULL;
sapi_info->filename=NULL;
sapi_info->query_string=NULL;
/* Make sure we detect we are a cgi - a bit redundancy here,
but the default case is that we have to check only the first one. */
***************
*** 426,435 ****
sapi_info->query_string = s;
}
! if (sapi_info->rqst_filename == NULL && !sapi_info->cgi && argc > arg) {
sapi_info->argv0 = strdup(argv[arg]);
- } else if (sapi_info->cgi) {
- sapi_info->rqst_filename=NULL;
}
sapi_init();
--- 409,416 ----
sapi_info->query_string = s;
}
! if (sapi_info->script_filename == NULL && !sapi_info->cgi && argc > arg)
{
sapi_info->argv0 = strdup(argv[arg]);
}
sapi_init();
--
PHP Development Mailing List http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net
For help: php-dev-help@lists.php.net