diff options
Diffstat (limited to 'main')
-rw-r--r-- | main/SAPI.c | 2 | ||||
-rw-r--r-- | main/SAPI.h | 2 | ||||
-rw-r--r-- | main/main.c | 59 | ||||
-rw-r--r-- | main/php.h | 2 | ||||
-rw-r--r-- | main/php_content_types.c | 30 | ||||
-rw-r--r-- | main/php_globals.h | 1 | ||||
-rw-r--r-- | main/php_ini.c | 4 | ||||
-rw-r--r-- | main/php_ticks.c | 12 | ||||
-rw-r--r-- | main/php_ticks.h | 6 | ||||
-rw-r--r-- | main/php_variables.c | 1 | ||||
-rw-r--r-- | main/php_version.h | 6 | ||||
-rw-r--r-- | main/streams/php_stream_context.h | 2 | ||||
-rw-r--r-- | main/streams/streams.c | 3 | ||||
-rw-r--r-- | main/streams/transports.c | 2 | ||||
-rw-r--r-- | main/streams/userspace.c | 4 |
15 files changed, 32 insertions, 104 deletions
diff --git a/main/SAPI.c b/main/SAPI.c index b182909c71..f9e4a9fe7f 100644 --- a/main/SAPI.c +++ b/main/SAPI.c @@ -999,7 +999,7 @@ SAPI_API int sapi_register_input_filter(unsigned int (*input_filter)(int arg, ch SAPI_API int sapi_flush(TSRMLS_D) { if (sapi_module.flush) { - sapi_module.flush(SG(server_context)); + sapi_module.flush(SG(server_context) TSRMLS_CC); return SUCCESS; } else { return FAILURE; diff --git a/main/SAPI.h b/main/SAPI.h index a2158a9590..71942f5663 100644 --- a/main/SAPI.h +++ b/main/SAPI.h @@ -227,7 +227,7 @@ struct _sapi_module_struct { int (*deactivate)(TSRMLS_D); int (*ub_write)(const char *str, unsigned int str_length TSRMLS_DC); - void (*flush)(void *server_context); + void (*flush)(void *server_context TSRMLS_DC); struct stat *(*get_stat)(TSRMLS_D); char *(*getenv)(char *name, size_t name_len TSRMLS_DC); diff --git a/main/main.c b/main/main.c index 2d59c46930..ebb158ac7c 100644 --- a/main/main.c +++ b/main/main.c @@ -179,7 +179,7 @@ static PHP_INI_MH(OnChangeMemoryLimit) } else { PG(memory_limit) = 1<<30; /* effectively, no limit */ } - return zend_set_memory_limit(PG(memory_limit)); + return zend_set_memory_limit(PG(memory_limit) TSRMLS_CC); } /* }}} */ @@ -460,40 +460,6 @@ static PHP_INI_MH(OnChangeMailForceExtra) /* defined in browscap.c */ PHP_INI_MH(OnChangeBrowscap); -/* {{{ PHP_INI_MH - */ -static PHP_INI_MH(OnChangeAlwaysPopulateRawPostData) -{ - signed char *p; -#ifndef ZTS - char *base = (char *) mh_arg2; -#else - char *base; - - base = (char *) ts_resource(*((int *) mh_arg2)); -#endif - - p = (signed char *) (base+(size_t) mh_arg1); - - *p = zend_atol(new_value, new_value_length); - if (new_value_length == 2 && strcasecmp("on", new_value) == 0) { - *p = (signed char) 1; - } - else if (new_value_length == 3 && strcasecmp("yes", new_value) == 0) { - *p = (signed char) 1; - } - else if (new_value_length == 4 && strcasecmp("true", new_value) == 0) { - *p = (signed char) 1; - } - else if (new_value_length == 5 && strcasecmp("never", new_value) == 0) { - *p = (signed char) -1; - } - else { - *p = (signed char) atoi(new_value); - } - return SUCCESS; -} -/* }}} */ /* Need to be read from the environment (?): * PHP_AUTO_PREPEND_FILE @@ -596,7 +562,6 @@ PHP_INI_BEGIN() STD_PHP_INI_BOOLEAN("allow_url_fopen", "1", PHP_INI_SYSTEM, OnUpdateBool, allow_url_fopen, php_core_globals, core_globals) STD_PHP_INI_BOOLEAN("allow_url_include", "0", PHP_INI_SYSTEM, OnUpdateBool, allow_url_include, php_core_globals, core_globals) STD_PHP_INI_BOOLEAN("enable_post_data_reading", "1", PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateBool, enable_post_data_reading, php_core_globals, core_globals) - STD_PHP_INI_ENTRY("always_populate_raw_post_data", "0", PHP_INI_SYSTEM|PHP_INI_PERDIR, OnChangeAlwaysPopulateRawPostData, always_populate_raw_post_data, php_core_globals, core_globals) STD_PHP_INI_ENTRY("realpath_cache_size", "16K", PHP_INI_SYSTEM, OnUpdateLong, realpath_cache_size_limit, virtual_cwd_globals, cwd_globals) STD_PHP_INI_ENTRY("realpath_cache_ttl", "120", PHP_INI_SYSTEM, OnUpdateLong, realpath_cache_ttl, virtual_cwd_globals, cwd_globals) @@ -1201,7 +1166,7 @@ static void php_error_cb(int type, const char *error_filename, const uint error_ CG(parse_error) = 0; } else { /* restore memory limit */ - zend_set_memory_limit(PG(memory_limit)); + zend_set_memory_limit(PG(memory_limit) TSRMLS_CC); efree(buffer); zend_objects_store_mark_destructed(&EG(objects_store) TSRMLS_CC); zend_bailout(); @@ -1828,7 +1793,7 @@ void php_request_shutdown(void *dummy) } } zend_end_try(); - /* 7.5 free last error information */ + /* 8. free last error information */ if (PG(last_error_message)) { free(PG(last_error_message)); PG(last_error_message) = NULL; @@ -1838,34 +1803,34 @@ void php_request_shutdown(void *dummy) PG(last_error_file) = NULL; } - /* 7. Shutdown scanner/executor/compiler and restore ini entries */ + /* 9. Shutdown scanner/executor/compiler and restore ini entries */ zend_deactivate(TSRMLS_C); - /* 8. Call all extensions post-RSHUTDOWN functions */ + /* 10. Call all extensions post-RSHUTDOWN functions */ zend_try { zend_post_deactivate_modules(TSRMLS_C); } zend_end_try(); - /* 9. SAPI related shutdown (free stuff) */ + /* 11. SAPI related shutdown (free stuff) */ zend_try { sapi_deactivate(TSRMLS_C); } zend_end_try(); - /* 9.5 free virtual CWD memory */ + /* 12. free virtual CWD memory */ virtual_cwd_deactivate(TSRMLS_C); - /* 10. Destroy stream hashes */ + /* 13. Destroy stream hashes */ zend_try { php_shutdown_stream_hashes(TSRMLS_C); } zend_end_try(); - /* 11. Free Willy (here be crashes) */ + /* 14. Free Willy (here be crashes) */ zend_try { shutdown_memory_manager(CG(unclean_shutdown) || !report_memleaks, 0 TSRMLS_CC); } zend_end_try(); zend_interned_strings_restore(TSRMLS_C); - /* 12. Reset max_execution_time */ + /* 15. Reset max_execution_time */ zend_try { zend_unset_timeout(TSRMLS_C); } zend_end_try(); @@ -2678,9 +2643,9 @@ PHPAPI int php_lint_script(zend_file_handle *file TSRMLS_DC) #ifdef PHP_WIN32 /* {{{ dummy_indent just so that this symbol gets exported... */ -PHPAPI void dummy_indent(void) +PHPAPI void dummy_indent(TSRMLS_D) { - zend_indent(); + zend_indent(TSRMLS_C); } /* }}} */ #endif diff --git a/main/php.h b/main/php.h index 8f8ad33d87..c2d0d936ca 100644 --- a/main/php.h +++ b/main/php.h @@ -26,7 +26,7 @@ #include <dmalloc.h> #endif -#define PHP_API_VERSION 20131106 +#define PHP_API_VERSION 20131218 #define PHP_HAVE_STREAMS #define YYDEBUG 0 diff --git a/main/php_content_types.c b/main/php_content_types.c index bc42c8094b..c8db921421 100644 --- a/main/php_content_types.c +++ b/main/php_content_types.c @@ -33,19 +33,6 @@ static sapi_post_entry php_post_entries[] = { }; /* }}} */ -static zend_bool populate_raw_post_data(TSRMLS_D) -{ - if (!SG(request_info).request_body) { - return (zend_bool) 0; - } - - if (!PG(always_populate_raw_post_data)) { - return (zend_bool) !SG(request_info).post_entry; - } - - return (zend_bool) (PG(always_populate_raw_post_data) > 0); -} - /* {{{ SAPI_POST_READER_FUNC */ SAPI_API SAPI_POST_READER_FUNC(php_default_post_reader) @@ -55,23 +42,6 @@ SAPI_API SAPI_POST_READER_FUNC(php_default_post_reader) /* no post handler registered, so we just swallow the data */ sapi_read_standard_form_data(TSRMLS_C); } - - if (populate_raw_post_data(TSRMLS_C)) { - size_t length; - char *data = NULL; - - php_stream_rewind(SG(request_info).request_body); - length = php_stream_copy_to_mem(SG(request_info).request_body, &data, PHP_STREAM_COPY_ALL, 0); - php_stream_rewind(SG(request_info).request_body); - - SET_VAR_STRINGL("HTTP_RAW_POST_DATA", data, length); - - sapi_module.sapi_error(E_DEPRECATED, - "Automatically populating $HTTP_RAW_POST_DATA is deprecated and " - "will be removed in a future version. To avoid this warning set " - "'always_populate_raw_post_data' to '-1' in php.ini and use the " - "php://input stream instead."); - } } } /* }}} */ diff --git a/main/php_globals.h b/main/php_globals.h index cf7998b83d..b8f64d6d31 100644 --- a/main/php_globals.h +++ b/main/php_globals.h @@ -131,7 +131,6 @@ struct _php_core_globals { zend_bool during_request_startup; zend_bool allow_url_fopen; zend_bool enable_post_data_reading; - signed char always_populate_raw_post_data; zend_bool report_zend_debug; int last_error_type; diff --git a/main/php_ini.c b/main/php_ini.c index e20ba4ba73..f7f4686e84 100644 --- a/main/php_ini.c +++ b/main/php_ini.c @@ -361,7 +361,7 @@ static void php_load_zend_extension_cb(void *arg TSRMLS_DC) int length = strlen(filename); if (IS_ABSOLUTE_PATH(filename, length)) { - zend_load_extension(filename); + zend_load_extension(filename TSRMLS_CC); } else { char *libpath; char *extension_dir = INI_STR("extension_dir"); @@ -372,7 +372,7 @@ static void php_load_zend_extension_cb(void *arg TSRMLS_DC) } else { spprintf(&libpath, 0, "%s%c%s", extension_dir, DEFAULT_SLASH, filename); } - zend_load_extension(libpath); + zend_load_extension(libpath TSRMLS_CC); efree(libpath); } } diff --git a/main/php_ticks.c b/main/php_ticks.c index b07f925fab..248b5a9e04 100644 --- a/main/php_ticks.c +++ b/main/php_ticks.c @@ -46,17 +46,13 @@ static int php_compare_tick_functions(void *elem1, void *elem2) return (func1 == func2); } -PHPAPI void php_add_tick_function(void (*func)(int)) +PHPAPI void php_add_tick_function(void (*func)(int) TSRMLS_DC) { - TSRMLS_FETCH(); - zend_llist_add_element(&PG(tick_functions), (void *)&func); } -PHPAPI void php_remove_tick_function(void (*func)(int)) +PHPAPI void php_remove_tick_function(void (*func)(int) TSRMLS_DC) { - TSRMLS_FETCH(); - zend_llist_del_element(&PG(tick_functions), (void *)func, (int(*)(void*, void*))php_compare_tick_functions); } @@ -69,10 +65,8 @@ static void php_tick_iterator(void *data, void *arg TSRMLS_DC) func(*((int *)arg)); } -void php_run_ticks(int count) +void php_run_ticks(int count TSRMLS_DC) { - TSRMLS_FETCH(); - zend_llist_apply_with_argument(&PG(tick_functions), (llist_apply_with_arg_func_t) php_tick_iterator, &count TSRMLS_CC); } diff --git a/main/php_ticks.h b/main/php_ticks.h index 0f58adac6a..b511949d80 100644 --- a/main/php_ticks.h +++ b/main/php_ticks.h @@ -24,11 +24,11 @@ int php_startup_ticks(TSRMLS_D); void php_deactivate_ticks(TSRMLS_D); void php_shutdown_ticks(TSRMLS_D); -void php_run_ticks(int count); +void php_run_ticks(int count TSRMLS_DC); BEGIN_EXTERN_C() -PHPAPI void php_add_tick_function(void (*func)(int)); -PHPAPI void php_remove_tick_function(void (*func)(int)); +PHPAPI void php_add_tick_function(void (*func)(int) TSRMLS_DC); +PHPAPI void php_remove_tick_function(void (*func)(int) TSRMLS_DC); END_EXTERN_C() #endif diff --git a/main/php_variables.c b/main/php_variables.c index f529898bf0..38cf043839 100644 --- a/main/php_variables.c +++ b/main/php_variables.c @@ -734,6 +734,7 @@ static zend_bool php_auto_globals_create_post(const char *name, uint name_len TS if (PG(variables_order) && (strchr(PG(variables_order),'P') || strchr(PG(variables_order),'p')) && + !SG(headers_sent) && SG(request_info).request_method && !strcasecmp(SG(request_info).request_method, "POST")) { sapi_module.treat_data(PARSE_POST, NULL, NULL TSRMLS_CC); diff --git a/main/php_version.h b/main/php_version.h index d48bf13c6f..87c2e4ac4d 100644 --- a/main/php_version.h +++ b/main/php_version.h @@ -1,8 +1,8 @@ /* automatically generated by configure */ /* edit configure.in to change version number */ #define PHP_MAJOR_VERSION 5 -#define PHP_MINOR_VERSION 6 +#define PHP_MINOR_VERSION 7 #define PHP_RELEASE_VERSION 0 #define PHP_EXTRA_VERSION "-dev" -#define PHP_VERSION "5.6.0-dev" -#define PHP_VERSION_ID 50600 +#define PHP_VERSION "5.7.0-dev" +#define PHP_VERSION_ID 50700 diff --git a/main/streams/php_stream_context.h b/main/streams/php_stream_context.h index 58b298b689..5c6925a856 100644 --- a/main/streams/php_stream_context.h +++ b/main/streams/php_stream_context.h @@ -87,7 +87,7 @@ END_EXTERN_C() BEGIN_EXTERN_C() PHPAPI void php_stream_notification_notify(php_stream_context *context, int notifycode, int severity, char *xmsg, int xcode, size_t bytes_sofar, size_t bytes_max, void * ptr TSRMLS_DC); -PHPAPI php_stream_context *php_stream_context_set(php_stream *stream, php_stream_context *context); +PHPAPI php_stream_context *php_stream_context_set(php_stream *stream, php_stream_context *context TSRMLS_DC); END_EXTERN_C() #define php_stream_notify_info(context, code, xmsg, xcode) do { if ((context) && (context)->notifier) { \ diff --git a/main/streams/streams.c b/main/streams/streams.c index 4713db151b..4c4764c1ea 100644 --- a/main/streams/streams.c +++ b/main/streams/streams.c @@ -2148,10 +2148,9 @@ PHPAPI php_stream *_php_stream_open_wrapper_ex(const char *path, const char *mod /* }}} */ /* {{{ context API */ -PHPAPI php_stream_context *php_stream_context_set(php_stream *stream, php_stream_context *context) +PHPAPI php_stream_context *php_stream_context_set(php_stream *stream, php_stream_context *context TSRMLS_DC) { php_stream_context *oldcontext = stream->context; - TSRMLS_FETCH(); stream->context = context; diff --git a/main/streams/transports.c b/main/streams/transports.c index a633b059fa..f54e8e6cdf 100644 --- a/main/streams/transports.c +++ b/main/streams/transports.c @@ -134,7 +134,7 @@ PHPAPI php_stream *_php_stream_xport_create(const char *name, size_t namelen, in context STREAMS_REL_CC TSRMLS_CC); if (stream) { - php_stream_context_set(stream, context); + php_stream_context_set(stream, context TSRMLS_CC); if ((flags & STREAM_XPORT_SERVER) == 0) { /* client */ diff --git a/main/streams/userspace.c b/main/streams/userspace.c index 5990464a6e..7d958729e5 100644 --- a/main/streams/userspace.c +++ b/main/streams/userspace.c @@ -1121,7 +1121,7 @@ static int php_userstreamop_set_option(php_stream *stream, int option, int value php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s::" USERSTREAM_SET_OPTION " is not implemented!", us->wrapper->classname); ret = PHP_STREAM_OPTION_RETURN_ERR; - } else if (retval && zend_is_true(retval)) { + } else if (retval && zend_is_true(retval TSRMLS_CC)) { ret = PHP_STREAM_OPTION_RETURN_OK; } else { ret = PHP_STREAM_OPTION_RETURN_ERR; @@ -1629,7 +1629,7 @@ static int php_userstreamop_cast(php_stream *stream, int castas, void **retptr T us->wrapper->classname); break; } - if (retval == NULL || !zend_is_true(retval)) { + if (retval == NULL || !zend_is_true(retval TSRMLS_CC)) { break; } php_stream_from_zval_no_verify(intstream, &retval); |