xref: /PHP-7.4/main/php_globals.h (revision 9499484e)
1 /*
2    +----------------------------------------------------------------------+
3    | PHP Version 7                                                        |
4    +----------------------------------------------------------------------+
5    | Copyright (c) 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_FAST(core_globals_offset, php_core_globals *, v)
28 extern PHPAPI int core_globals_id;
29 extern PHPAPI size_t core_globals_offset;
30 #else
31 # define PG(v) (core_globals.v)
32 extern ZEND_API struct _php_core_globals core_globals;
33 #endif
34 
35 /* Error display modes */
36 #define PHP_DISPLAY_ERRORS_STDOUT	1
37 #define PHP_DISPLAY_ERRORS_STDERR	2
38 
39 /* Track vars */
40 #define TRACK_VARS_POST		0
41 #define TRACK_VARS_GET		1
42 #define TRACK_VARS_COOKIE	2
43 #define TRACK_VARS_SERVER	3
44 #define TRACK_VARS_ENV		4
45 #define TRACK_VARS_FILES	5
46 #define TRACK_VARS_REQUEST	6
47 
48 struct _php_tick_function_entry;
49 
50 typedef struct _arg_separators {
51 	char *output;
52 	char *input;
53 } arg_separators;
54 
55 struct _php_core_globals {
56 	zend_bool implicit_flush;
57 
58 	zend_long output_buffering;
59 
60 	zend_bool enable_dl;
61 
62 	char *output_handler;
63 
64 	char *unserialize_callback_func;
65 	zend_long serialize_precision;
66 
67 	zend_long memory_limit;
68 	zend_long max_input_time;
69 
70 	zend_bool track_errors;
71 	zend_bool display_errors;
72 	zend_bool display_startup_errors;
73 	zend_bool log_errors;
74 	zend_long      log_errors_max_len;
75 	zend_bool ignore_repeated_errors;
76 	zend_bool ignore_repeated_source;
77 	zend_bool report_memleaks;
78 	char *error_log;
79 
80 	char *doc_root;
81 	char *user_dir;
82 	char *include_path;
83 	char *open_basedir;
84 	char *extension_dir;
85 	char *php_binary;
86 	char *sys_temp_dir;
87 
88 	char *upload_tmp_dir;
89 	zend_long upload_max_filesize;
90 
91 	char *error_append_string;
92 	char *error_prepend_string;
93 
94 	char *auto_prepend_file;
95 	char *auto_append_file;
96 
97 	char *input_encoding;
98 	char *internal_encoding;
99 	char *output_encoding;
100 
101 	arg_separators arg_separator;
102 
103 	char *variables_order;
104 
105 	HashTable rfc1867_protected_variables;
106 
107 	short connection_status;
108 	zend_bool ignore_user_abort;
109 
110 	unsigned char header_is_being_sent;
111 
112 	zend_llist tick_functions;
113 
114 	zval http_globals[6];
115 
116 	zend_bool expose_php;
117 
118 	zend_bool register_argc_argv;
119 	zend_bool auto_globals_jit;
120 
121 	char *docref_root;
122 	char *docref_ext;
123 
124 	zend_bool html_errors;
125 	zend_bool xmlrpc_errors;
126 
127 	zend_long xmlrpc_error_number;
128 
129 	zend_bool activated_auto_globals[8];
130 
131 	zend_bool modules_activated;
132 	zend_bool file_uploads;
133 	zend_bool during_request_startup;
134 	zend_bool allow_url_fopen;
135 	zend_bool enable_post_data_reading;
136 	zend_bool report_zend_debug;
137 
138 	int last_error_type;
139 	char *last_error_message;
140 	char *last_error_file;
141 	int  last_error_lineno;
142 
143 	char *php_sys_temp_dir;
144 
145 	char *disable_functions;
146 	char *disable_classes;
147 	zend_bool allow_url_include;
148 #ifdef PHP_WIN32
149 	zend_bool com_initialized;
150 #endif
151 	zend_long max_input_nesting_level;
152 	zend_long max_input_vars;
153 	zend_bool in_user_include;
154 
155 	char *user_ini_filename;
156 	zend_long user_ini_cache_ttl;
157 
158 	char *request_order;
159 
160 	zend_bool mail_x_header;
161 	char *mail_log;
162 
163 	zend_bool in_error_log;
164 
165 #ifdef PHP_WIN32
166 	zend_bool windows_show_crt_warning;
167 #endif
168 
169 	zend_long syslog_facility;
170 	char *syslog_ident;
171 	zend_bool have_called_openlog;
172 	zend_long syslog_filter;
173 };
174 
175 
176 #endif /* PHP_GLOBALS_H */
177