xref: /PHP-7.4/main/php_globals.h (revision 9499484e)
1c5724cbdSZeev Suraski /*
2c5724cbdSZeev Suraski    +----------------------------------------------------------------------+
3d0cb7153SJohannes Schlüter    | PHP Version 7                                                        |
4c5724cbdSZeev Suraski    +----------------------------------------------------------------------+
50cf7de1cSZeev Suraski    | Copyright (c) The PHP Group                                          |
6c5724cbdSZeev Suraski    +----------------------------------------------------------------------+
75bd93221Sfoobar    | This source file is subject to version 3.01 of the PHP license,      |
8c5724cbdSZeev Suraski    | that is bundled with this package in the file LICENSE, and is        |
9f68c7ff2SJames Cox    | available through the world-wide-web at the following url:           |
105bd93221Sfoobar    | http://www.php.net/license/3_01.txt                                  |
11c5724cbdSZeev Suraski    | If you did not receive a copy of the PHP license and are unable to   |
12c5724cbdSZeev Suraski    | obtain it through the world-wide-web, please send a note to          |
13c5724cbdSZeev Suraski    | license@php.net so we can mail you a copy immediately.               |
14c5724cbdSZeev Suraski    +----------------------------------------------------------------------+
1567e0138cSZeev Suraski    | Author: Zeev Suraski <zeev@php.net>                                  |
16c5724cbdSZeev Suraski    +----------------------------------------------------------------------+
17c5724cbdSZeev Suraski */
18c5724cbdSZeev Suraski 
1916017f6dSSascha Schumann #ifndef PHP_GLOBALS_H
2016017f6dSSascha Schumann #define PHP_GLOBALS_H
21011813ccSZeev Suraski 
22c5af324eSZeev Suraski #include "zend_globals.h"
23c5af324eSZeev Suraski 
24011813ccSZeev Suraski typedef struct _php_core_globals php_core_globals;
25011813ccSZeev Suraski 
26011813ccSZeev Suraski #ifdef ZTS
27*9499484eSDmitry Stogov # define PG(v) ZEND_TSRMG_FAST(core_globals_offset, php_core_globals *, v)
28d11734b4SAnatol Belski extern PHPAPI int core_globals_id;
29*9499484eSDmitry Stogov extern PHPAPI size_t core_globals_offset;
30011813ccSZeev Suraski #else
31011813ccSZeev Suraski # define PG(v) (core_globals.v)
325a2189f3SSascha Schumann extern ZEND_API struct _php_core_globals core_globals;
33011813ccSZeev Suraski #endif
34011813ccSZeev Suraski 
35335cac3cSJani Taskinen /* Error display modes */
36335cac3cSJani Taskinen #define PHP_DISPLAY_ERRORS_STDOUT	1
37335cac3cSJani Taskinen #define PHP_DISPLAY_ERRORS_STDERR	2
38eb321449SZeev Suraski 
39335cac3cSJani Taskinen /* Track vars */
40bfa301dfSZeev Suraski #define TRACK_VARS_POST		0
41bfa301dfSZeev Suraski #define TRACK_VARS_GET		1
42bfa301dfSZeev Suraski #define TRACK_VARS_COOKIE	2
43bfa301dfSZeev Suraski #define TRACK_VARS_SERVER	3
44bfa301dfSZeev Suraski #define TRACK_VARS_ENV		4
45bfa301dfSZeev Suraski #define TRACK_VARS_FILES	5
464e55747aSZeev Suraski #define TRACK_VARS_REQUEST	6
470e90b9dcSZeev Suraski 
48d23e5d83SStig Bakken struct _php_tick_function_entry;
49011813ccSZeev Suraski 
50c34d2b91Sfoobar typedef struct _arg_separators {
51c34d2b91Sfoobar 	char *output;
52c34d2b91Sfoobar 	char *input;
53c34d2b91Sfoobar } arg_separators;
54c34d2b91Sfoobar 
55011813ccSZeev Suraski struct _php_core_globals {
5624156db2SZeev Suraski 	zend_bool implicit_flush;
5779f9f0ceSZeev Suraski 
58c3e3c98eSAnatol Belski 	zend_long output_buffering;
59e077c6bcSZeev Suraski 
6054ec3a8eSRasmus Lerdorf 	zend_bool enable_dl;
610f7f5c2cSZeev Suraski 
620f7f5c2cSZeev Suraski 	char *output_handler;
630f7f5c2cSZeev Suraski 
6406cdf297SDerick Rethans 	char *unserialize_callback_func;
65c3e3c98eSAnatol Belski 	zend_long serialize_precision;
6606cdf297SDerick Rethans 
67c3e3c98eSAnatol Belski 	zend_long memory_limit;
68c3e3c98eSAnatol Belski 	zend_long max_input_time;
69e3d2234bSZeev Suraski 
7054ec3a8eSRasmus Lerdorf 	zend_bool track_errors;
7154ec3a8eSRasmus Lerdorf 	zend_bool display_errors;
72b7ecaacdSZeev Suraski 	zend_bool display_startup_errors;
7354ec3a8eSRasmus Lerdorf 	zend_bool log_errors;
74c3e3c98eSAnatol Belski 	zend_long      log_errors_max_len;
75ddc6437eSMarcus Boerger 	zend_bool ignore_repeated_errors;
76ddc6437eSMarcus Boerger 	zend_bool ignore_repeated_source;
77d812929dSDerick Rethans 	zend_bool report_memleaks;
78f86fb810SZeev Suraski 	char *error_log;
79bb6dff9cSZeev Suraski 
80f86fb810SZeev Suraski 	char *doc_root;
81f86fb810SZeev Suraski 	char *user_dir;
82f86fb810SZeev Suraski 	char *include_path;
83f86fb810SZeev Suraski 	char *open_basedir;
84f86fb810SZeev Suraski 	char *extension_dir;
85b5766cdcSXinchen Hui 	char *php_binary;
86475a644bSALeX Kazik 	char *sys_temp_dir;
87bb6dff9cSZeev Suraski 
88f86fb810SZeev Suraski 	char *upload_tmp_dir;
89c3e3c98eSAnatol Belski 	zend_long upload_max_filesize;
90b7a7b1a6SStanislav Malyshev 
916727342bSRasmus Lerdorf 	char *error_append_string;
926727342bSRasmus Lerdorf 	char *error_prepend_string;
936727342bSRasmus Lerdorf 
94f86fb810SZeev Suraski 	char *auto_prepend_file;
95f86fb810SZeev Suraski 	char *auto_append_file;
96bb6dff9cSZeev Suraski 
97cbd108abSYasuo Ohgaki 	char *input_encoding;
98cbd108abSYasuo Ohgaki 	char *internal_encoding;
99cbd108abSYasuo Ohgaki 	char *output_encoding;
100cbd108abSYasuo Ohgaki 
101c34d2b91Sfoobar 	arg_separators arg_separator;
102c34d2b91Sfoobar 
1039ab35ae3SZeev Suraski 	char *variables_order;
104bb6dff9cSZeev Suraski 
105ed453cc9SZeev Suraski 	HashTable rfc1867_protected_variables;
106ed453cc9SZeev Suraski 
1070bede914SRasmus Lerdorf 	short connection_status;
108d46d53a7SSara Golemon 	zend_bool ignore_user_abort;
1090bede914SRasmus Lerdorf 
110f86fb810SZeev Suraski 	unsigned char header_is_being_sent;
111d23e5d83SStig Bakken 
112d23e5d83SStig Bakken 	zend_llist tick_functions;
1130e90b9dcSZeev Suraski 
114f4cfaf36SDmitry Stogov 	zval http_globals[6];
1158fb954aeSZeev Suraski 
1168fb954aeSZeev Suraski 	zend_bool expose_php;
1178fb954aeSZeev Suraski 
1188fb954aeSZeev Suraski 	zend_bool register_argc_argv;
11902344b1dSZeev Suraski 	zend_bool auto_globals_jit;
1208fb954aeSZeev Suraski 
12188c385e8SMarcus Boerger 	char *docref_root;
12288c385e8SMarcus Boerger 	char *docref_ext;
12388c385e8SMarcus Boerger 
12423ca7b9fSStig Bakken 	zend_bool html_errors;
125a2ce3c70SSascha Schumann 	zend_bool xmlrpc_errors;
126a2ce3c70SSascha Schumann 
127c3e3c98eSAnatol Belski 	zend_long xmlrpc_error_number;
128a2ce3c70SSascha Schumann 
1294e55747aSZeev Suraski 	zend_bool activated_auto_globals[8];
13023ca7b9fSStig Bakken 
131b7ecaacdSZeev Suraski 	zend_bool modules_activated;
132b7ecaacdSZeev Suraski 	zend_bool file_uploads;
133b7ecaacdSZeev Suraski 	zend_bool during_request_startup;
134cae27179SHartmut Holzgraefe 	zend_bool allow_url_fopen;
1356654a4adSGustavo André dos Santos Lopes 	zend_bool enable_post_data_reading;
136b7cd48efSMarcus Boerger 	zend_bool report_zend_debug;
1373fc4a327SMarcus Boerger 
13846f21b8aSMichael Wallner 	int last_error_type;
1393fc4a327SMarcus Boerger 	char *last_error_message;
1403fc4a327SMarcus Boerger 	char *last_error_file;
1413fc4a327SMarcus Boerger 	int  last_error_lineno;
142be5670afSIlia Alshanetsky 
1436a819bbaSJulien Pauli 	char *php_sys_temp_dir;
1446a819bbaSJulien Pauli 
145be5670afSIlia Alshanetsky 	char *disable_functions;
146be5670afSIlia Alshanetsky 	char *disable_classes;
1476bfeea9eSRasmus Lerdorf 	zend_bool allow_url_include;
148c06f9e1eSDmitry Stogov #ifdef PHP_WIN32
149c06f9e1eSDmitry Stogov 	zend_bool com_initialized;
150c06f9e1eSDmitry Stogov #endif
151c3e3c98eSAnatol Belski 	zend_long max_input_nesting_level;
152c3e3c98eSAnatol Belski 	zend_long max_input_vars;
153539f67edSDmitry Stogov 	zend_bool in_user_include;
15409b6f37fSJani Taskinen 
15509b6f37fSJani Taskinen 	char *user_ini_filename;
156c3e3c98eSAnatol Belski 	zend_long user_ini_cache_ttl;
157a9fe1010SStanislav Malyshev 
158a9fe1010SStanislav Malyshev 	char *request_order;
159905a5c05SIlia Alshanetsky 
160905a5c05SIlia Alshanetsky 	zend_bool mail_x_header;
161905a5c05SIlia Alshanetsky 	char *mail_log;
162ffb07732SDmitry Stogov 
163ffb07732SDmitry Stogov 	zend_bool in_error_log;
164e9ebd1c6SKalle Sommer Nielsen 
165e9ebd1c6SKalle Sommer Nielsen #ifdef PHP_WIN32
166e9ebd1c6SKalle Sommer Nielsen 	zend_bool windows_show_crt_warning;
167e9ebd1c6SKalle Sommer Nielsen #endif
1682475337bSPhilip Prindeville 
1692475337bSPhilip Prindeville 	zend_long syslog_facility;
1702475337bSPhilip Prindeville 	char *syslog_ident;
1712475337bSPhilip Prindeville 	zend_bool have_called_openlog;
1722010c02eSPhilip Prindeville 	zend_long syslog_filter;
173011813ccSZeev Suraski };
174011813ccSZeev Suraski 
175011813ccSZeev Suraski 
17616017f6dSSascha Schumann #endif /* PHP_GLOBALS_H */
177