diff options
author | Ondřej Surý <ondrej@sury.org> | 2014-03-27 15:35:16 +0100 |
---|---|---|
committer | Ondřej Surý <ondrej@sury.org> | 2014-03-27 15:35:16 +0100 |
commit | 30bdcf2392ef8cc7b8b4a07b49367571ae1db286 (patch) | |
tree | c98975e6a71c722e7ce3b31c7c221ceb0e9a1f25 /main | |
parent | d67160a566757f858e5883201e518230f5221c6b (diff) | |
download | php-30bdcf2392ef8cc7b8b4a07b49367571ae1db286.tar.gz |
New upstream version 5.6.0~alpha3+dfsgupstream/5.6.0_alpha3+dfsg
Diffstat (limited to 'main')
-rw-r--r-- | main/SAPI.h | 3 | ||||
-rw-r--r-- | main/main.c | 46 | ||||
-rw-r--r-- | main/php.h | 1 | ||||
-rw-r--r-- | main/php_globals.h | 4 | ||||
-rw-r--r-- | main/php_version.h | 4 | ||||
-rw-r--r-- | main/streams/php_stream_transport.h | 35 |
6 files changed, 74 insertions, 19 deletions
diff --git a/main/SAPI.h b/main/SAPI.h index a2158a959..990ca6990 100644 --- a/main/SAPI.h +++ b/main/SAPI.h @@ -21,6 +21,7 @@ #ifndef SAPI_H #define SAPI_H +#include "php.h" #include "zend.h" #include "zend_API.h" #include "zend_llist.h" @@ -291,7 +292,7 @@ struct _sapi_post_entry { #define SAPI_HEADER_SEND_FAILED 3 #define SAPI_DEFAULT_MIMETYPE "text/html" -#define SAPI_DEFAULT_CHARSET "" +#define SAPI_DEFAULT_CHARSET PHP_DEFAULT_CHARSET #define SAPI_PHP_VERSION_HEADER "X-Powered-By: PHP/" PHP_VERSION #define SAPI_POST_READER_FUNC(post_reader) void post_reader(TSRMLS_D) diff --git a/main/main.c b/main/main.c index 2d59c4693..abe032af7 100644 --- a/main/main.c +++ b/main/main.c @@ -417,6 +417,45 @@ static PHP_INI_DISP(display_errors_mode) /* {{{ PHP_INI_MH */ +static PHP_INI_MH(OnUpdateInternalEncoding) +{ + if (new_value_length) { + OnUpdateString(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC); + } else { + OnUpdateString(entry, SG(default_charset), strlen(SG(default_charset))+1, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC); + } + return SUCCESS; +} +/* }}} */ + +/* {{{ PHP_INI_MH + */ +static PHP_INI_MH(OnUpdateInputEncoding) +{ + if (new_value_length) { + OnUpdateString(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC); + } else { + OnUpdateString(entry, SG(default_charset), strlen(SG(default_charset))+1, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC); + } + return SUCCESS; +} +/* }}} */ + +/* {{{ PHP_INI_MH + */ +static PHP_INI_MH(OnUpdateOutputEncoding) +{ + if (new_value_length) { + OnUpdateString(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC); + } else { + OnUpdateString(entry, SG(default_charset), strlen(SG(default_charset))+1, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC); + } + return SUCCESS; +} +/* }}} */ + +/* {{{ PHP_INI_MH + */ static PHP_INI_MH(OnUpdateErrorLog) { /* Only do the safemode/open_basedir check at runtime */ @@ -556,8 +595,11 @@ PHP_INI_BEGIN() STD_PHP_INI_ENTRY("auto_append_file", NULL, PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateString, auto_append_file, php_core_globals, core_globals) STD_PHP_INI_ENTRY("auto_prepend_file", NULL, PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateString, auto_prepend_file, php_core_globals, core_globals) STD_PHP_INI_ENTRY("doc_root", NULL, PHP_INI_SYSTEM, OnUpdateStringUnempty, doc_root, php_core_globals, core_globals) - STD_PHP_INI_ENTRY("default_charset", SAPI_DEFAULT_CHARSET, PHP_INI_ALL, OnUpdateString, default_charset, sapi_globals_struct,sapi_globals) - STD_PHP_INI_ENTRY("default_mimetype", SAPI_DEFAULT_MIMETYPE, PHP_INI_ALL, OnUpdateString, default_mimetype, sapi_globals_struct,sapi_globals) + STD_PHP_INI_ENTRY("default_charset", PHP_DEFAULT_CHARSET, PHP_INI_ALL, OnUpdateString, default_charset, sapi_globals_struct, sapi_globals) + STD_PHP_INI_ENTRY("default_mimetype", SAPI_DEFAULT_MIMETYPE, PHP_INI_ALL, OnUpdateString, default_mimetype, sapi_globals_struct, sapi_globals) + STD_PHP_INI_ENTRY("internal_encoding", "", PHP_INI_ALL, OnUpdateInternalEncoding, internal_encoding, php_core_globals, core_globals) + STD_PHP_INI_ENTRY("input_encoding", "", PHP_INI_ALL, OnUpdateInputEncoding, input_encoding, php_core_globals, core_globals) + STD_PHP_INI_ENTRY("output_encoding", "", PHP_INI_ALL, OnUpdateOutputEncoding, output_encoding, php_core_globals, core_globals) STD_PHP_INI_ENTRY("error_log", NULL, PHP_INI_ALL, OnUpdateErrorLog, error_log, php_core_globals, core_globals) STD_PHP_INI_ENTRY("extension_dir", PHP_EXTENSION_DIR, PHP_INI_SYSTEM, OnUpdateStringUnempty, extension_dir, php_core_globals, core_globals) STD_PHP_INI_ENTRY("sys_temp_dir", NULL, PHP_INI_SYSTEM, OnUpdateStringUnempty, sys_temp_dir, php_core_globals, core_globals) diff --git a/main/php.h b/main/php.h index 8f8ad33d8..4330479d5 100644 --- a/main/php.h +++ b/main/php.h @@ -29,6 +29,7 @@ #define PHP_API_VERSION 20131106 #define PHP_HAVE_STREAMS #define YYDEBUG 0 +#define PHP_DEFAULT_CHARSET "UTF-8" #include "php_version.h" #include "zend.h" diff --git a/main/php_globals.h b/main/php_globals.h index cf7998b83..e135d6186 100644 --- a/main/php_globals.h +++ b/main/php_globals.h @@ -96,6 +96,10 @@ struct _php_core_globals { char *auto_prepend_file; char *auto_append_file; + char *input_encoding; + char *internal_encoding; + char *output_encoding; + arg_separators arg_separator; char *variables_order; diff --git a/main/php_version.h b/main/php_version.h index 5397c471c..201422687 100644 --- a/main/php_version.h +++ b/main/php_version.h @@ -3,6 +3,6 @@ #define PHP_MAJOR_VERSION 5 #define PHP_MINOR_VERSION 6 #define PHP_RELEASE_VERSION 0 -#define PHP_EXTRA_VERSION "alpha2" -#define PHP_VERSION "5.6.0alpha2" +#define PHP_EXTRA_VERSION "alpha3" +#define PHP_VERSION "5.6.0alpha3" #define PHP_VERSION_ID 50600 diff --git a/main/streams/php_stream_transport.h b/main/streams/php_stream_transport.h index c599a65d0..dc10eb4e9 100644 --- a/main/streams/php_stream_transport.h +++ b/main/streams/php_stream_transport.h @@ -163,23 +163,30 @@ typedef struct _php_stream_xport_param { } outputs; } php_stream_xport_param; - -/* These functions provide crypto support on the underlying transport */ +/* Because both client and server streams use the same mechanisms + for encryption we use the LSB to denote clients. +*/ typedef enum { - STREAM_CRYPTO_METHOD_SSLv2_CLIENT, - STREAM_CRYPTO_METHOD_SSLv3_CLIENT, - STREAM_CRYPTO_METHOD_SSLv23_CLIENT, - STREAM_CRYPTO_METHOD_TLS_CLIENT, - STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT, - STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT, - STREAM_CRYPTO_METHOD_SSLv2_SERVER, - STREAM_CRYPTO_METHOD_SSLv3_SERVER, - STREAM_CRYPTO_METHOD_SSLv23_SERVER, - STREAM_CRYPTO_METHOD_TLS_SERVER, - STREAM_CRYPTO_METHOD_TLSv1_1_SERVER, - STREAM_CRYPTO_METHOD_TLSv1_2_SERVER + STREAM_CRYPTO_METHOD_SSLv2_CLIENT = (1 << 1 | 1), + STREAM_CRYPTO_METHOD_SSLv3_CLIENT = (1 << 2 | 1), + STREAM_CRYPTO_METHOD_SSLv23_CLIENT = ((1 << 1) | (1 << 2) | 1), + STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT = (1 << 3 | 1), + STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT = (1 << 4 | 1), + STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT = (1 << 5 | 1), + STREAM_CRYPTO_METHOD_TLS_CLIENT = ((1 << 3) | (1 << 4) | (1 << 5) | 1), + STREAM_CRYPTO_METHOD_ANY_CLIENT = ((1 << 1) | (1 << 2) | (1 << 3) | (1 << 4) | (1 << 5) | 1), + STREAM_CRYPTO_METHOD_SSLv2_SERVER = (1 << 1), + STREAM_CRYPTO_METHOD_SSLv3_SERVER = (1 << 2), + STREAM_CRYPTO_METHOD_SSLv23_SERVER = ((1 << 1) | (1 << 2)), + STREAM_CRYPTO_METHOD_TLSv1_0_SERVER = (1 << 3), + STREAM_CRYPTO_METHOD_TLSv1_1_SERVER = (1 << 4), + STREAM_CRYPTO_METHOD_TLSv1_2_SERVER = (1 << 5), + STREAM_CRYPTO_METHOD_TLS_SERVER = ((1 << 3) | (1 << 4) | (1 << 5)), + STREAM_CRYPTO_METHOD_ANY_SERVER = ((1 << 1) | (1 << 2) | (1 << 3) | (1 << 4) | (1 << 5)) } php_stream_xport_crypt_method_t; +/* These functions provide crypto support on the underlying transport */ + BEGIN_EXTERN_C() PHPAPI int php_stream_xport_crypto_setup(php_stream *stream, php_stream_xport_crypt_method_t crypto_method, php_stream *session_stream TSRMLS_DC); PHPAPI int php_stream_xport_crypto_enable(php_stream *stream, int activate TSRMLS_DC); |