xref: /PHP-7.3/main/php_globals.h (revision 9afce019)
1 /*
2    +----------------------------------------------------------------------+
3    | PHP Version 7                                                        |
4    +----------------------------------------------------------------------+
5    | Copyright (c) 1997-2018 The PHP Group                                |
6    +----------------------------------------------------------------------+
7    | This source file is subject to version 3.01 of the PHP license,      |
8    | that is bundled with this package in the file LICENSE, and is        |
9    | available through the world-wide-web at the following url:           |
10    | http://www.php.net/license/3_01.txt                                  |
11    | If you did not receive a copy of the PHP license and are unable to   |
12    | obtain it through the world-wide-web, please send a note to          |
13    | license@php.net so we can mail you a copy immediately.               |
14    +----------------------------------------------------------------------+
15    | Author: Zeev Suraski <zeev@php.net>                                  |
16    +----------------------------------------------------------------------+
17 */
18 
19 #ifndef PHP_GLOBALS_H
20 #define PHP_GLOBALS_H
21 
22 #include "zend_globals.h"
23 
24 typedef struct _php_core_globals php_core_globals;
25 
26 #ifdef ZTS
27 # define PG(v) ZEND_TSRMG(core_globals_id, php_core_globals *, v)
28 extern PHPAPI int core_globals_id;
29 #else
30 # define PG(v) (core_globals.v)
31 extern ZEND_API struct _php_core_globals core_globals;
32 #endif
33 
34 /* Error display modes */
35 #define PHP_DISPLAY_ERRORS_STDOUT	1
36 #define PHP_DISPLAY_ERRORS_STDERR	2
37 
38 /* Track vars */
39 #define TRACK_VARS_POST		0
40 #define TRACK_VARS_GET		1
41 #define TRACK_VARS_COOKIE	2
42 #define TRACK_VARS_SERVER	3
43 #define TRACK_VARS_ENV		4
44 #define TRACK_VARS_FILES	5
45 #define TRACK_VARS_REQUEST	6
46 
47 struct _php_tick_function_entry;
48 
49 typedef struct _arg_separators {
50 	char *output;
51 	char *input;
52 } arg_separators;
53 
54 struct _php_core_globals {
55 	zend_bool implicit_flush;
56 
57 	zend_long output_buffering;
58 
59 	zend_bool enable_dl;
60 
61 	char *output_handler;
62 
63 	char *unserialize_callback_func;
64 	zend_long serialize_precision;
65 
66 	zend_long memory_limit;
67 	zend_long max_input_time;
68 
69 	zend_bool track_errors;
70 	zend_bool display_errors;
71 	zend_bool display_startup_errors;
72 	zend_bool log_errors;
73 	zend_long      log_errors_max_len;
74 	zend_bool ignore_repeated_errors;
75 	zend_bool ignore_repeated_source;
76 	zend_bool report_memleaks;
77 	char *error_log;
78 
79 	char *doc_root;
80 	char *user_dir;
81 	char *include_path;
82 	char *open_basedir;
83 	char *extension_dir;
84 	char *php_binary;
85 	char *sys_temp_dir;
86 
87 	char *upload_tmp_dir;
88 	zend_long upload_max_filesize;
89 
90 	char *error_append_string;
91 	char *error_prepend_string;
92 
93 	char *auto_prepend_file;
94 	char *auto_append_file;
95 
96 	char *input_encoding;
97 	char *internal_encoding;
98 	char *output_encoding;
99 
100 	arg_separators arg_separator;
101 
102 	char *variables_order;
103 
104 	HashTable rfc1867_protected_variables;
105 
106 	short connection_status;
107 	zend_bool ignore_user_abort;
108 
109 	unsigned char header_is_being_sent;
110 
111 	zend_llist tick_functions;
112 
113 	zval http_globals[6];
114 
115 	zend_bool expose_php;
116 
117 	zend_bool register_argc_argv;
118 	zend_bool auto_globals_jit;
119 
120 	char *docref_root;
121 	char *docref_ext;
122 
123 	zend_bool html_errors;
124 	zend_bool xmlrpc_errors;
125 
126 	zend_long xmlrpc_error_number;
127 
128 	zend_bool activated_auto_globals[8];
129 
130 	zend_bool modules_activated;
131 	zend_bool file_uploads;
132 	zend_bool during_request_startup;
133 	zend_bool allow_url_fopen;
134 	zend_bool enable_post_data_reading;
135 	zend_bool report_zend_debug;
136 
137 	int last_error_type;
138 	char *last_error_message;
139 	char *last_error_file;
140 	int  last_error_lineno;
141 
142 	char *php_sys_temp_dir;
143 
144 	char *disable_functions;
145 	char *disable_classes;
146 	zend_bool allow_url_include;
147 #ifdef PHP_WIN32
148 	zend_bool com_initialized;
149 #endif
150 	zend_long max_input_nesting_level;
151 	zend_long max_input_vars;
152 	zend_bool in_user_include;
153 
154 	char *user_ini_filename;
155 	zend_long user_ini_cache_ttl;
156 
157 	char *request_order;
158 
159 	zend_bool mail_x_header;
160 	char *mail_log;
161 
162 	zend_bool in_error_log;
163 
164 #ifdef PHP_WIN32
165 	zend_bool windows_show_crt_warning;
166 #endif
167 
168 	zend_long syslog_facility;
169 	char *syslog_ident;
170 	zend_bool have_called_openlog;
171 	zend_long syslog_filter;
172 };
173 
174 
175 #endif /* PHP_GLOBALS_H */
176 
177 /*
178  * Local variables:
179  * tab-width: 4
180  * c-basic-offset: 4
181  * End:
182  * vim600: sw=4 ts=4 fdm=marker
183  * vim<600: sw=4 ts=4
184  */
185