If you like SEOmastering Forum, you can support it by - BTC: bc1qppjcl3c2cyjazy6lepmrv3fh6ke9mxs7zpfky0 , TRC20 and more...

 

SAPI Globals (SG)

Started by beingchinmay, 08-10-2016, 04:40:58

Previous topic - Next topic

beingchinmayTopic starter

SAPI is the Server Abstraction API. It contains any variables related to the web server under which PHP is running. Note that not all SAPI modules are related to web servers. The command-line version of PHP, for example, uses the CGI SAPI layer. There is also a Java SAPI module. You can check which SAPI module you are running under by including SAPI.h and then checking sapi_module.name:

Quote#include <SAPI.h>
/* then in a function */
printf("the SAPI module is %s\n", sapi_module.name);

See the sapi_globals_struct in the main/SAPI.h file for a list of available SAPI globals. For example, to access the default_mimetype SAPI global, you would use:

SG(default_mimetype)

Some elements of the SAPI globals structure are themselves structures with fields. For example, to access the request_uri, use:

SG(request_info).request_uri



If you like SEOmastering Forum, you can support it by - BTC: bc1qppjcl3c2cyjazy6lepmrv3fh6ke9mxs7zpfky0 , TRC20 and more...