summaryrefslogtreecommitdiff
path: root/main/php_globals.h
blob: e619694d18a528894cea2cc836ad08f15e888c86 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
/*
   +----------------------------------------------------------------------+
   | Copyright (c) The PHP Group                                          |
   +----------------------------------------------------------------------+
   | This source file is subject to version 3.01 of the PHP license,      |
   | that is bundled with this package in the file LICENSE, and is        |
   | available through the world-wide-web at the following url:           |
   | http://www.php.net/license/3_01.txt                                  |
   | If you did not receive a copy of the PHP license and are unable to   |
   | obtain it through the world-wide-web, please send a note to          |
   | license@php.net so we can mail you a copy immediately.               |
   +----------------------------------------------------------------------+
   | Author: Zeev Suraski <zeev@php.net>                                  |
   +----------------------------------------------------------------------+
*/

#ifndef PHP_GLOBALS_H
#define PHP_GLOBALS_H

#include "zend_globals.h"

typedef struct _php_core_globals php_core_globals;

#ifdef ZTS
# define PG(v) ZEND_TSRMG_FAST(core_globals_offset, php_core_globals *, v)
extern PHPAPI int core_globals_id;
extern PHPAPI size_t core_globals_offset;
#else
# define PG(v) (core_globals.v)
extern ZEND_API struct _php_core_globals core_globals;
#endif

/* Error display modes */
#define PHP_DISPLAY_ERRORS_STDOUT	1
#define PHP_DISPLAY_ERRORS_STDERR	2

/* Track vars */
#define TRACK_VARS_POST		0
#define TRACK_VARS_GET		1
#define TRACK_VARS_COOKIE	2
#define TRACK_VARS_SERVER	3
#define TRACK_VARS_ENV		4
#define TRACK_VARS_FILES	5
#define TRACK_VARS_REQUEST	6

struct _php_tick_function_entry;

typedef struct _arg_separators {
	char *output;
	char *input;
} arg_separators;

struct _php_core_globals {
	bool implicit_flush;

	zend_long output_buffering;

	bool enable_dl;

	char *output_handler;

	char *unserialize_callback_func;
	zend_long serialize_precision;

	zend_long memory_limit;
	zend_long max_input_time;

	zend_uchar display_errors;
	bool display_startup_errors;
	bool log_errors;
	zend_long      log_errors_max_len;
	bool ignore_repeated_errors;
	bool ignore_repeated_source;
	bool report_memleaks;
	char *error_log;

	char *doc_root;
	char *user_dir;
	char *include_path;
	char *open_basedir;
	char *extension_dir;
	char *php_binary;
	char *sys_temp_dir;

	char *upload_tmp_dir;
	zend_long upload_max_filesize;

	char *error_append_string;
	char *error_prepend_string;

	char *auto_prepend_file;
	char *auto_append_file;

	char *input_encoding;
	char *internal_encoding;
	char *output_encoding;

	arg_separators arg_separator;

	char *variables_order;

	HashTable rfc1867_protected_variables;

	short connection_status;
	bool ignore_user_abort;

	unsigned char header_is_being_sent;

	zend_llist tick_functions;

	zval http_globals[6];

	bool expose_php;

	bool register_argc_argv;
	bool auto_globals_jit;

	char *docref_root;
	char *docref_ext;

	bool html_errors;
	bool xmlrpc_errors;

	zend_long xmlrpc_error_number;

	bool activated_auto_globals[8];

	bool modules_activated;
	bool file_uploads;
	bool during_request_startup;
	bool allow_url_fopen;
	bool enable_post_data_reading;
	bool report_zend_debug;

	int last_error_type;
	zend_string *last_error_message;
	char *last_error_file;
	int  last_error_lineno;

	char *php_sys_temp_dir;

	char *disable_classes;
	bool allow_url_include;
#ifdef PHP_WIN32
	bool com_initialized;
#endif
	zend_long max_input_nesting_level;
	zend_long max_input_vars;
	bool in_user_include;

	char *user_ini_filename;
	zend_long user_ini_cache_ttl;

	char *request_order;

	bool mail_x_header;
	char *mail_log;

	bool in_error_log;

#ifdef PHP_WIN32
	bool windows_show_crt_warning;
#endif

	zend_long syslog_facility;
	char *syslog_ident;
	bool have_called_openlog;
	zend_long syslog_filter;
};


#endif /* PHP_GLOBALS_H */