1999-07-16 21:13:16 +08:00
|
|
|
/*
|
|
|
|
+----------------------------------------------------------------------+
|
2014-09-20 00:33:14 +08:00
|
|
|
| PHP Version 7 |
|
1999-07-16 21:13:16 +08:00
|
|
|
+----------------------------------------------------------------------+
|
2018-01-02 12:53:31 +08:00
|
|
|
| Copyright (c) 1997-2018 The PHP Group |
|
1999-07-16 21:13:16 +08:00
|
|
|
+----------------------------------------------------------------------+
|
2006-01-01 20:51:34 +08:00
|
|
|
| This source file is subject to version 3.01 of the PHP license, |
|
1999-07-16 21:13:16 +08:00
|
|
|
| that is bundled with this package in the file LICENSE, and is |
|
2003-06-11 04:04:29 +08:00
|
|
|
| available through the world-wide-web at the following url: |
|
2006-01-01 20:51:34 +08:00
|
|
|
| http://www.php.net/license/3_01.txt |
|
1999-07-16 21:13:16 +08:00
|
|
|
| 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. |
|
|
|
|
+----------------------------------------------------------------------+
|
2002-02-28 16:29:35 +08:00
|
|
|
| Author: Zeev Suraski <zeev@zend.com> |
|
1999-07-16 21:13:16 +08:00
|
|
|
+----------------------------------------------------------------------+
|
|
|
|
*/
|
|
|
|
|
2003-02-19 16:40:19 +08:00
|
|
|
/* $Id$ */
|
1999-07-16 21:13:16 +08:00
|
|
|
|
2000-07-03 07:46:51 +08:00
|
|
|
#ifndef PHP_GLOBALS_H
|
|
|
|
#define PHP_GLOBALS_H
|
1999-04-10 03:16:46 +08:00
|
|
|
|
1999-04-21 12:02:11 +08:00
|
|
|
#include "zend_globals.h"
|
|
|
|
|
1999-04-10 03:16:46 +08:00
|
|
|
typedef struct _php_core_globals php_core_globals;
|
|
|
|
|
|
|
|
#ifdef ZTS
|
2014-10-07 15:09:46 +08:00
|
|
|
# define PG(v) ZEND_TSRMG(core_globals_id, php_core_globals *, v)
|
reworked the patch, less new stuff but worky
TLS is already used in TSRM, the way exporting the tsrm cache through
a thread local variable is not portable. Additionally, the current
patch suffers from bugs which are hard to find, but prevent it to
be worky with apache. What is done here is mainly uses the idea
from the RFC patch, but
- __thread variable is removed
- offset math and declarations are removed
- extra macros and definitions are removed
What is done merely is
- use an inline function to access the tsrm cache. The function uses
the portable tsrm_tls_get macro which is cheap
- all the TSRM_* macros are set to placebo. Thus this opens the way
remove them later
Except that, the logic is old. TSRMLS_FETCH will have to be done once
per thread, then tsrm_get_ls_cache() can be used. Things seeming to be
worky are cli, cli server and apache. I also tried to enable bz2
shared and it has worked out of the box. The change is yet minimal
diffing to the current master bus is a worky start, IMHO. Though will
have to recheck the other previously done SAPIs - embed and cgi.
The offsets can be added to the tsrm_resource_type struct, then
it'll not be needed to declare them in the userspace. Even the
"done" member type can be changed to int16 or smaller, then adding
the offset as int16 will not change the struct size. As well on the
todo might be removing the hashed storage, thread_id != thread_id and
linked list logic in favour of the explicit TLS operations.
2014-09-26 00:48:27 +08:00
|
|
|
extern PHPAPI int core_globals_id;
|
1999-04-10 03:16:46 +08:00
|
|
|
#else
|
|
|
|
# define PG(v) (core_globals.v)
|
1999-09-05 19:38:01 +08:00
|
|
|
extern ZEND_API struct _php_core_globals core_globals;
|
1999-04-10 03:16:46 +08:00
|
|
|
#endif
|
|
|
|
|
2007-07-24 22:21:36 +08:00
|
|
|
/* Error display modes */
|
|
|
|
#define PHP_DISPLAY_ERRORS_STDOUT 1
|
|
|
|
#define PHP_DISPLAY_ERRORS_STDERR 2
|
2000-09-06 03:06:29 +08:00
|
|
|
|
2007-07-24 22:21:36 +08:00
|
|
|
/* Track vars */
|
2000-09-06 12:56:22 +08:00
|
|
|
#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
|
2003-03-02 18:19:15 +08:00
|
|
|
#define TRACK_VARS_REQUEST 6
|
2000-02-27 00:36:57 +08:00
|
|
|
|
2000-02-26 05:27:03 +08:00
|
|
|
struct _php_tick_function_entry;
|
1999-04-10 03:16:46 +08:00
|
|
|
|
2001-04-05 04:46:26 +08:00
|
|
|
typedef struct _arg_separators {
|
|
|
|
char *output;
|
|
|
|
char *input;
|
|
|
|
} arg_separators;
|
|
|
|
|
1999-04-10 03:16:46 +08:00
|
|
|
struct _php_core_globals {
|
2000-01-14 04:39:33 +08:00
|
|
|
zend_bool implicit_flush;
|
1999-04-10 20:17:20 +08:00
|
|
|
|
2014-08-26 01:24:55 +08:00
|
|
|
zend_long output_buffering;
|
2001-08-12 06:55:00 +08:00
|
|
|
|
1999-09-05 06:06:12 +08:00
|
|
|
zend_bool sql_safe_mode;
|
|
|
|
zend_bool enable_dl;
|
2000-11-14 02:54:37 +08:00
|
|
|
|
|
|
|
char *output_handler;
|
|
|
|
|
2001-11-27 05:04:21 +08:00
|
|
|
char *unserialize_callback_func;
|
2014-08-26 01:24:55 +08:00
|
|
|
zend_long serialize_precision;
|
2001-11-27 05:04:21 +08:00
|
|
|
|
2014-08-26 01:24:55 +08:00
|
|
|
zend_long memory_limit;
|
|
|
|
zend_long max_input_time;
|
1999-04-10 21:32:47 +08:00
|
|
|
|
1999-09-05 06:06:12 +08:00
|
|
|
zend_bool track_errors;
|
|
|
|
zend_bool display_errors;
|
2000-09-09 23:02:15 +08:00
|
|
|
zend_bool display_startup_errors;
|
1999-09-05 06:06:12 +08:00
|
|
|
zend_bool log_errors;
|
2014-08-26 01:24:55 +08:00
|
|
|
zend_long log_errors_max_len;
|
2002-04-07 02:49:59 +08:00
|
|
|
zend_bool ignore_repeated_errors;
|
|
|
|
zend_bool ignore_repeated_source;
|
2002-06-27 03:43:46 +08:00
|
|
|
zend_bool report_memleaks;
|
1999-06-16 03:05:01 +08:00
|
|
|
char *error_log;
|
1999-04-11 00:25:23 +08:00
|
|
|
|
1999-06-16 03:05:01 +08:00
|
|
|
char *doc_root;
|
|
|
|
char *user_dir;
|
|
|
|
char *include_path;
|
|
|
|
char *open_basedir;
|
|
|
|
char *extension_dir;
|
2011-12-07 18:33:13 +08:00
|
|
|
char *php_binary;
|
2013-01-19 00:13:39 +08:00
|
|
|
char *sys_temp_dir;
|
1999-04-11 00:25:23 +08:00
|
|
|
|
1999-06-16 03:05:01 +08:00
|
|
|
char *upload_tmp_dir;
|
2014-08-26 01:24:55 +08:00
|
|
|
zend_long upload_max_filesize;
|
2015-01-03 17:22:58 +08:00
|
|
|
|
2000-04-14 22:00:32 +08:00
|
|
|
char *error_append_string;
|
|
|
|
char *error_prepend_string;
|
|
|
|
|
1999-06-16 03:05:01 +08:00
|
|
|
char *auto_prepend_file;
|
|
|
|
char *auto_append_file;
|
1999-04-11 00:25:23 +08:00
|
|
|
|
2014-02-13 10:54:52 +08:00
|
|
|
char *input_encoding;
|
|
|
|
char *internal_encoding;
|
|
|
|
char *output_encoding;
|
|
|
|
|
2001-04-05 04:46:26 +08:00
|
|
|
arg_separators arg_separator;
|
|
|
|
|
2000-01-29 01:24:53 +08:00
|
|
|
char *variables_order;
|
1999-04-11 00:25:23 +08:00
|
|
|
|
2000-09-05 03:07:50 +08:00
|
|
|
HashTable rfc1867_protected_variables;
|
|
|
|
|
1999-09-05 04:12:47 +08:00
|
|
|
short connection_status;
|
2018-01-24 00:06:34 +08:00
|
|
|
|
|
|
|
/* In 7.1/7.2 branches, this was initially a short,
|
|
|
|
* maintain struct alignment with subsequent padding.
|
|
|
|
*/
|
2018-01-23 21:46:38 +08:00
|
|
|
zend_bool ignore_user_abort;
|
2018-01-24 00:06:34 +08:00
|
|
|
char ignore_user_abort_reserved_padding;
|
1999-09-05 04:12:47 +08:00
|
|
|
|
1999-06-16 03:05:01 +08:00
|
|
|
unsigned char header_is_being_sent;
|
2000-02-26 05:27:03 +08:00
|
|
|
|
|
|
|
zend_llist tick_functions;
|
2000-02-27 00:36:57 +08:00
|
|
|
|
2014-02-10 14:04:30 +08:00
|
|
|
zval http_globals[6];
|
2000-05-30 02:45:06 +08:00
|
|
|
|
|
|
|
zend_bool expose_php;
|
|
|
|
|
|
|
|
zend_bool register_argc_argv;
|
2004-03-17 03:49:19 +08:00
|
|
|
zend_bool auto_globals_jit;
|
2000-05-30 02:45:06 +08:00
|
|
|
|
2002-08-09 03:12:27 +08:00
|
|
|
char *docref_root;
|
|
|
|
char *docref_ext;
|
|
|
|
|
2000-07-04 17:15:06 +08:00
|
|
|
zend_bool html_errors;
|
2001-07-10 23:59:33 +08:00
|
|
|
zend_bool xmlrpc_errors;
|
|
|
|
|
2014-08-26 01:24:55 +08:00
|
|
|
zend_long xmlrpc_error_number;
|
2001-07-10 23:59:33 +08:00
|
|
|
|
2003-03-02 18:19:15 +08:00
|
|
|
zend_bool activated_auto_globals[8];
|
2000-07-04 17:15:06 +08:00
|
|
|
|
2000-09-09 23:02:15 +08:00
|
|
|
zend_bool modules_activated;
|
|
|
|
zend_bool file_uploads;
|
|
|
|
zend_bool during_request_startup;
|
2000-10-13 08:09:31 +08:00
|
|
|
zend_bool allow_url_fopen;
|
2010-12-10 04:35:59 +08:00
|
|
|
zend_bool enable_post_data_reading;
|
2002-11-21 22:56:06 +08:00
|
|
|
zend_bool report_zend_debug;
|
2003-05-07 09:02:23 +08:00
|
|
|
|
2006-07-19 20:25:46 +08:00
|
|
|
int last_error_type;
|
2003-05-07 09:02:23 +08:00
|
|
|
char *last_error_message;
|
|
|
|
char *last_error_file;
|
|
|
|
int last_error_lineno;
|
2003-12-25 00:38:22 +08:00
|
|
|
|
2015-04-29 20:35:35 +08:00
|
|
|
char *php_sys_temp_dir;
|
|
|
|
|
2003-12-25 00:38:22 +08:00
|
|
|
char *disable_functions;
|
|
|
|
char *disable_classes;
|
2006-06-16 22:09:01 +08:00
|
|
|
zend_bool allow_url_include;
|
2006-11-17 19:40:52 +08:00
|
|
|
#ifdef PHP_WIN32
|
|
|
|
zend_bool com_initialized;
|
|
|
|
#endif
|
2014-08-26 01:24:55 +08:00
|
|
|
zend_long max_input_nesting_level;
|
|
|
|
zend_long max_input_vars;
|
2007-07-10 01:27:24 +08:00
|
|
|
zend_bool in_user_include;
|
2007-09-28 10:05:10 +08:00
|
|
|
|
|
|
|
char *user_ini_filename;
|
2014-08-26 01:24:55 +08:00
|
|
|
zend_long user_ini_cache_ttl;
|
2008-03-13 04:24:45 +08:00
|
|
|
|
|
|
|
char *request_order;
|
2009-01-09 22:59:30 +08:00
|
|
|
|
|
|
|
zend_bool mail_x_header;
|
|
|
|
char *mail_log;
|
2009-10-05 21:56:49 +08:00
|
|
|
|
|
|
|
zend_bool in_error_log;
|
2011-09-13 22:35:12 +08:00
|
|
|
|
|
|
|
#ifdef PHP_WIN32
|
|
|
|
zend_bool windows_show_crt_warning;
|
|
|
|
#endif
|
1999-04-10 03:16:46 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2000-07-03 07:46:51 +08:00
|
|
|
#endif /* PHP_GLOBALS_H */
|
1999-06-16 01:06:22 +08:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Local variables:
|
|
|
|
* tab-width: 4
|
|
|
|
* c-basic-offset: 4
|
|
|
|
* End:
|
|
|
|
*/
|