RE: [PHP-DEV] RE: apache sapi globals

From: Date: Sat, 22 Aug 1998 18:23:08 +0000
Subject: RE: [PHP-DEV] RE: apache sapi globals
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-488@lists.php.net to get a copy of this message
> > > Log Message: > > > Apache module is very close to compiling now. Just need > to figure out > > > how to get at globals from apache_sapi.c > > > > What do you need to know? > > I need to get at php3_HeaderPrinted > > I just extern'ed them for now, but when not compiling as a thread-safe > library, how should I be fetching it? > > -Rasmus Here's some general info... Always use globals as GLOBAL(variable), and static vars as STATIC(variable). Then the variable also has to be in the structure located in tls.h. The regular declaration of the global or static variable must also be within #ifndef THREAD_SAFE statements. I'm going to look at some way of optimizing the way tls.h is handled (zeev's ini stuff got me thinking :). In the SAPI interface, we always pass php3_globals to the functions from php core. Then there is a define for SAPI_FUNC_VARS (defined in php3_apache.h) that splits out php3_globals, sapi_info and php3_rqst from that. So having that define at the beginning of your function provides you with the structure from tls.h. With the apache sapi module, there are to c files, apache_sapi.c and mod_php3.c. Right now, no functions in mod_php3.h can get the SAPI_FUNC_VARS, so there has to be a buffer function inside apache_sapi.c for some of them (see php3_create_dir, php3_merge_dir and php3_set_ini). This I am sure can be optimized, I just did it for a quick fix to get things working. There are also some things in main.c that must be addressed for apache. They have FIXME's by them. Shane -- 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

« previous php.dev (#488) next »