summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSascha Schumann <sas@php.net>2001-09-30 18:23:28 +0000
committerSascha Schumann <sas@php.net>2001-09-30 18:23:28 +0000
commit6db3f409d83e3821f1d08e4b8b7d337a2cffe70c (patch)
tree2b2dc48d80498e7c5098e4ddf612538ea8175582
parent2eabb14dc72359e062c6b5a1a44150fb3d4c99ff (diff)
downloadphp-git-6db3f409d83e3821f1d08e4b8b7d337a2cffe70c.tar.gz
Add QUERY_STRING, HTTP_HOST, HTTP_ACCEPT_LANGUAGE to the script
environment. Also support setting the INI path from the outside.
-rw-r--r--sapi/thttpd/thttpd.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/sapi/thttpd/thttpd.c b/sapi/thttpd/thttpd.c
index ddb531a644..9ccac35130 100644
--- a/sapi/thttpd/thttpd.c
+++ b/sapi/thttpd/thttpd.c
@@ -27,6 +27,7 @@
#include "ext/standard/php_smart_str.h"
#include <sys/uio.h>
+#include <stdlib.h>
typedef struct {
httpd_conn *hc;
@@ -199,9 +200,12 @@ static void sapi_thttpd_register_variables(zval *track_vars_array TSRMLS_DC)
php_register_variable(#name, TG(hc)->field, track_vars_array TSRMLS_CC); \
}
+ CONDADD(QUERY_STRING, query);
+ CONDADD(HTTP_HOST, hdrhost);
CONDADD(HTTP_REFERER, referer);
CONDADD(HTTP_USER_AGENT, useragent);
CONDADD(HTTP_ACCEPT, accept);
+ CONDADD(HTTP_ACCEPT_LANGUAGE, acceptl);
CONDADD(HTTP_ACCEPT_ENCODING, accepte);
CONDADD(HTTP_COOKIE, cookie);
CONDADD(CONTENT_TYPE, contenttype);
@@ -537,14 +541,22 @@ void thttpd_set_dont_close(void)
void thttpd_php_init(void)
{
+ char *ini;
+
#ifdef ZTS
tsrm_startup(1, 1, 0, NULL);
ts_allocate_id(&thttpd_globals_id, sizeof(php_thttpd_globals), NULL, NULL);
qr_lock = tsrm_mutex_alloc();
thttpd_register_on_close(remove_dead_conn);
#endif
+
+ if ((ini = getenv("PHP_INI_PATH"))) {
+ thttpd_sapi_module.php_ini_path_override = ini;
+ }
+
sapi_startup(&thttpd_sapi_module);
thttpd_sapi_module.startup(&thttpd_sapi_module);
+
{
TSRMLS_FETCH();