mirror of
https://github.com/php/php-src.git
synced 2025-08-18 15:08:55 +02:00
Add QUERY_STRING, HTTP_HOST, HTTP_ACCEPT_LANGUAGE to the script
environment. Also support setting the INI path from the outside.
This commit is contained in:
parent
2eabb14dc7
commit
6db3f409d8
1 changed files with 12 additions and 0 deletions
|
@ -27,6 +27,7 @@
|
||||||
#include "ext/standard/php_smart_str.h"
|
#include "ext/standard/php_smart_str.h"
|
||||||
|
|
||||||
#include <sys/uio.h>
|
#include <sys/uio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
httpd_conn *hc;
|
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); \
|
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_REFERER, referer);
|
||||||
CONDADD(HTTP_USER_AGENT, useragent);
|
CONDADD(HTTP_USER_AGENT, useragent);
|
||||||
CONDADD(HTTP_ACCEPT, accept);
|
CONDADD(HTTP_ACCEPT, accept);
|
||||||
|
CONDADD(HTTP_ACCEPT_LANGUAGE, acceptl);
|
||||||
CONDADD(HTTP_ACCEPT_ENCODING, accepte);
|
CONDADD(HTTP_ACCEPT_ENCODING, accepte);
|
||||||
CONDADD(HTTP_COOKIE, cookie);
|
CONDADD(HTTP_COOKIE, cookie);
|
||||||
CONDADD(CONTENT_TYPE, contenttype);
|
CONDADD(CONTENT_TYPE, contenttype);
|
||||||
|
@ -537,14 +541,22 @@ void thttpd_set_dont_close(void)
|
||||||
|
|
||||||
void thttpd_php_init(void)
|
void thttpd_php_init(void)
|
||||||
{
|
{
|
||||||
|
char *ini;
|
||||||
|
|
||||||
#ifdef ZTS
|
#ifdef ZTS
|
||||||
tsrm_startup(1, 1, 0, NULL);
|
tsrm_startup(1, 1, 0, NULL);
|
||||||
ts_allocate_id(&thttpd_globals_id, sizeof(php_thttpd_globals), NULL, NULL);
|
ts_allocate_id(&thttpd_globals_id, sizeof(php_thttpd_globals), NULL, NULL);
|
||||||
qr_lock = tsrm_mutex_alloc();
|
qr_lock = tsrm_mutex_alloc();
|
||||||
thttpd_register_on_close(remove_dead_conn);
|
thttpd_register_on_close(remove_dead_conn);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if ((ini = getenv("PHP_INI_PATH"))) {
|
||||||
|
thttpd_sapi_module.php_ini_path_override = ini;
|
||||||
|
}
|
||||||
|
|
||||||
sapi_startup(&thttpd_sapi_module);
|
sapi_startup(&thttpd_sapi_module);
|
||||||
thttpd_sapi_module.startup(&thttpd_sapi_module);
|
thttpd_sapi_module.startup(&thttpd_sapi_module);
|
||||||
|
|
||||||
{
|
{
|
||||||
TSRMLS_FETCH();
|
TSRMLS_FETCH();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue