com php-src: backported main/: main/SAPI.c main/SAPI.h main/main.c main/php.h main/php_content_types.c main/php_globals .h main/php_ini.c
main/php_ticks.c main/php_t icks.h main/php_variables.c main/php_version.h
| From: | Anatol Belski | Date: | Sat, 15 Feb 2014 13:33:11 +0000 |
| Subject: | com php-src: backported main/: main/SAPI.c main/SAPI.h main/main.c main/php.h main/php_content_types.c main/php_globals .h main/php_ini.c main/php_ticks.c main/php_t icks.h main/php_variables.c main/php_version.h |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-76081@lists.php.net to get a copy of this message | ||
Commit: 9a7f242f861ee2a27cde1794aa1b0f4119102fde
Author: Anatol Belski <ab@php.net> Sat, 15 Feb 2014 14:33:11 +0100
Parents: 2fd7f7c8252a8d55d3227527fe1e21acbfd22878
Branches: str_size_and_int64_56_backport
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=9a7f242f861ee2a27cde1794aa1b0f4119102fde
Log:
backported main/
Changed paths:
M main/SAPI.c
M main/SAPI.h
M main/main.c
M main/php.h
M main/php_content_types.c
M main/php_globals.h
M main/php_ini.c
M main/php_ticks.c
M main/php_ticks.h
M main/php_variables.c
M main/php_version.h
diff --git a/main/SAPI.c b/main/SAPI.c index 68cfb2c..b984bfd 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) TSRMLS_CC); + sapi_module.flush(SG(server_context)); return SUCCESS; } else { return FAILURE; diff --git a/main/SAPI.h b/main/SAPI.h index 588def4..55c80fd 100644 --- a/main/SAPI.h +++ b/main/SAPI.h @@ -229,7 +229,7 @@ struct _sapi_module_struct { int (*deactivate)(TSRMLS_D); php_size_t (*ub_write)(const char *str, php_size_t str_length TSRMLS_DC); - void (*flush)(void *server_context TSRMLS_DC); + void (*flush)(void *server_context); zend_stat_t *(*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 7fcf3f4..fe9663e 100644 --- a/main/main.c +++ b/main/main.c @@ -181,7 +181,7 @@ static PHP_INI_MH(OnChangeMemoryLimit) } else { PG(memory_limit) = 1<<30; /* effectively, no limit */ } - return zend_set_memory_limit(PG(memory_limit) TSRMLS_CC); + return zend_set_memory_limit(PG(memory_limit)); } /* }}} */ @@ -502,6 +502,40 @@ 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 { + ZEND_ATOI(new_value, *p); + } + return SUCCESS; +} +/* }}} */ /* Need to be read from the environment (?): * PHP_AUTO_PREPEND_FILE @@ -607,6 +641,7 @@ 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) @@ -690,7 +725,7 @@ PHPAPI void php_log_err(char *log_message TSRMLS_DC) #ifdef PHP_WIN32 php_flock(fd, 2); #endif - php_ignore_value(write(fd, tmp, len)); /* XXX rework on windows, write expects int*/ + php_ignore_value(write(fd, tmp, len)); efree(tmp); efree(error_time_str); close(fd); @@ -1212,7 +1247,7 @@ static void php_error_cb(int type, const char *error_filename, const php_size_t CG(parse_error) = 0; } else { /* restore memory limit */ - zend_set_memory_limit(PG(memory_limit) TSRMLS_CC); + zend_set_memory_limit(PG(memory_limit)); efree(buffer); zend_objects_store_mark_destructed(&EG(objects_store) TSRMLS_CC); zend_bailout(); @@ -1839,7 +1874,7 @@ void php_request_shutdown(void *dummy) } } zend_end_try(); - /* 8. free last error information */ + /* 7.5 free last error information */ if (PG(last_error_message)) { free(PG(last_error_message)); PG(last_error_message) = NULL; @@ -1849,34 +1884,34 @@ void php_request_shutdown(void *dummy) PG(last_error_file) = NULL; } - /* 9. Shutdown scanner/executor/compiler and restore ini entries */ + /* 7. Shutdown scanner/executor/compiler and restore ini entries */ zend_deactivate(TSRMLS_C); - /* 10. Call all extensions post-RSHUTDOWN functions */ + /* 8. Call all extensions post-RSHUTDOWN functions */ zend_try { zend_post_deactivate_modules(TSRMLS_C); } zend_end_try(); - /* 11. SAPI related shutdown (free stuff) */ + /* 9. SAPI related shutdown (free stuff) */ zend_try { sapi_deactivate(TSRMLS_C); } zend_end_try(); - /* 12. free virtual CWD memory */ + /* 9.5 free virtual CWD memory */ virtual_cwd_deactivate(TSRMLS_C); - /* 13. Destroy stream hashes */ + /* 10. Destroy stream hashes */ zend_try { php_shutdown_stream_hashes(TSRMLS_C); } zend_end_try(); - /* 14. Free Willy (here be crashes) */ + /* 11. 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); - /* 15. Reset max_execution_time */ + /* 12. Reset max_execution_time */ zend_try { zend_unset_timeout(TSRMLS_C); } zend_end_try(); @@ -2689,9 +2724,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(TSRMLS_D) +PHPAPI void dummy_indent(void) { - zend_indent(TSRMLS_C); + zend_indent(); } /* }}} */ #endif diff --git a/main/php.h b/main/php.h index 68e9486..f7410d5 100644 --- a/main/php.h +++ b/main/php.h @@ -26,7 +26,7 @@ #include <dmalloc.h> #endif -#define PHP_API_VERSION 20131218 +#define PHP_API_VERSION 20131106 #define PHP_HAVE_STREAMS #define YYDEBUG 0 #define PHP_DEFAULT_CHARSET "UTF-8" diff --git a/main/php_content_types.c b/main/php_content_types.c index c8db921..bc42c80 100644 --- a/main/php_content_types.c +++ b/main/php_content_types.c @@ -33,6 +33,19 @@ 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) @@ -42,6 +55,23 @@ 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 e4f26b5..8d3914a 100644 --- a/main/php_globals.h +++ b/main/php_globals.h @@ -135,6 +135,7 @@ 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 0d6e502..52e59ca 100644 --- a/main/php_ini.c +++ b/main/php_ini.c @@ -362,7 +362,7 @@ static void php_load_zend_extension_cb(void *arg TSRMLS_DC) php_size_t length = strlen(filename); if (IS_ABSOLUTE_PATH(filename, length)) { - zend_load_extension(filename TSRMLS_CC); + zend_load_extension(filename); } else { char *libpath; char *extension_dir = INI_STR("extension_dir"); @@ -373,7 +373,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 TSRMLS_CC); + zend_load_extension(libpath); efree(libpath); } } diff --git a/main/php_ticks.c b/main/php_ticks.c index 248b5a9..b07f925 100644 --- a/main/php_ticks.c +++ b/main/php_ticks.c @@ -46,13 +46,17 @@ static int php_compare_tick_functions(void *elem1, void *elem2) return (func1 == func2); } -PHPAPI void php_add_tick_function(void (*func)(int) TSRMLS_DC) +PHPAPI void php_add_tick_function(void (*func)(int)) { + TSRMLS_FETCH(); + zend_llist_add_element(&PG(tick_functions), (void *)&func); } -PHPAPI void php_remove_tick_function(void (*func)(int) TSRMLS_DC) +PHPAPI void php_remove_tick_function(void (*func)(int)) { + TSRMLS_FETCH(); + zend_llist_del_element(&PG(tick_functions), (void *)func, (int(*)(void*, void*))php_compare_tick_functions); } @@ -65,8 +69,10 @@ static void php_tick_iterator(void *data, void *arg TSRMLS_DC) func(*((int *)arg)); } -void php_run_ticks(int count TSRMLS_DC) +void php_run_ticks(int count) { + 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 b511949..0f58ada 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 TSRMLS_DC); +void php_run_ticks(int count); BEGIN_EXTERN_C() -PHPAPI void php_add_tick_function(void (*func)(int) TSRMLS_DC); -PHPAPI void php_remove_tick_function(void (*func)(int) TSRMLS_DC); +PHPAPI void php_add_tick_function(void (*func)(int)); +PHPAPI void php_remove_tick_function(void (*func)(int)); END_EXTERN_C() #endif diff --git a/main/php_variables.c b/main/php_variables.c index 7c13424..8e2671d 100644 --- a/main/php_variables.c +++ b/main/php_variables.c @@ -731,7 +731,6 @@ static zend_bool php_auto_globals_create_post(const char *name, php_size_t name_ 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 87c2e4a..d48bf13 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 7 +#define PHP_MINOR_VERSION 6 #define PHP_RELEASE_VERSION 0 #define PHP_EXTRA_VERSION "-dev" -#define PHP_VERSION "5.7.0-dev" -#define PHP_VERSION_ID 50700 +#define PHP_VERSION "5.6.0-dev" +#define PHP_VERSION_ID 50600
diff --git a/main/SAPI.c b/main/SAPI.c index 68cfb2c..b984bfd 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) TSRMLS_CC); + sapi_module.flush(SG(server_context)); return SUCCESS; } else { return FAILURE; diff --git a/main/SAPI.h b/main/SAPI.h index 588def4..55c80fd 100644 --- a/main/SAPI.h +++ b/main/SAPI.h @@ -229,7 +229,7 @@ struct _sapi_module_struct { int (*deactivate)(TSRMLS_D); php_size_t (*ub_write)(const char *str, php_size_t str_length TSRMLS_DC); - void (*flush)(void *server_context TSRMLS_DC); + void (*flush)(void *server_context); zend_stat_t *(*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 7fcf3f4..fe9663e 100644 --- a/main/main.c +++ b/main/main.c @@ -181,7 +181,7 @@ static PHP_INI_MH(OnChangeMemoryLimit) } else { PG(memory_limit) = 1<<30; /* effectively, no limit */ } - return zend_set_memory_limit(PG(memory_limit) TSRMLS_CC); + return zend_set_memory_limit(PG(memory_limit)); } /* }}} */ @@ -502,6 +502,40 @@ 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 { + ZEND_ATOI(new_value, *p); + } + return SUCCESS; +} +/* }}} */ /* Need to be read from the environment (?): * PHP_AUTO_PREPEND_FILE @@ -607,6 +641,7 @@ 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) @@ -690,7 +725,7 @@ PHPAPI void php_log_err(char *log_message TSRMLS_DC) #ifdef PHP_WIN32 php_flock(fd, 2); #endif - php_ignore_value(write(fd, tmp, len)); /* XXX rework on windows, write expects int*/ + php_ignore_value(write(fd, tmp, len)); efree(tmp); efree(error_time_str); close(fd); @@ -1212,7 +1247,7 @@ static void php_error_cb(int type, const char *error_filename, const php_size_t CG(parse_error) = 0; } else { /* restore memory limit */ - zend_set_memory_limit(PG(memory_limit) TSRMLS_CC); + zend_set_memory_limit(PG(memory_limit)); efree(buffer); zend_objects_store_mark_destructed(&EG(objects_store) TSRMLS_CC); zend_bailout(); @@ -1839,7 +1874,7 @@ void php_request_shutdown(void *dummy) } } zend_end_try(); - /* 8. free last error information */ + /* 7.5 free last error information */ if (PG(last_error_message)) { free(PG(last_error_message)); PG(last_error_message) = NULL; @@ -1849,34 +1884,34 @@ void php_request_shutdown(void *dummy) PG(last_error_file) = NULL; } - /* 9. Shutdown scanner/executor/compiler and restore ini entries */ + /* 7. Shutdown scanner/executor/compiler and restore ini entries */ zend_deactivate(TSRMLS_C); - /* 10. Call all extensions post-RSHUTDOWN functions */ + /* 8. Call all extensions post-RSHUTDOWN functions */ zend_try { zend_post_deactivate_modules(TSRMLS_C); } zend_end_try(); - /* 11. SAPI related shutdown (free stuff) */ + /* 9. SAPI related shutdown (free stuff) */ zend_try { sapi_deactivate(TSRMLS_C); } zend_end_try(); - /* 12. free virtual CWD memory */ + /* 9.5 free virtual CWD memory */ virtual_cwd_deactivate(TSRMLS_C); - /* 13. Destroy stream hashes */ + /* 10. Destroy stream hashes */ zend_try { php_shutdown_stream_hashes(TSRMLS_C); } zend_end_try(); - /* 14. Free Willy (here be crashes) */ + /* 11. 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); - /* 15. Reset max_execution_time */ + /* 12. Reset max_execution_time */ zend_try { zend_unset_timeout(TSRMLS_C); } zend_end_try(); @@ -2689,9 +2724,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(TSRMLS_D) +PHPAPI void dummy_indent(void) { - zend_indent(TSRMLS_C); + zend_indent(); } /* }}} */ #endif diff --git a/main/php.h b/main/php.h index 68e9486..f7410d5 100644 --- a/main/php.h +++ b/main/php.h @@ -26,7 +26,7 @@ #include <dmalloc.h> #endif -#define PHP_API_VERSION 20131218 +#define PHP_API_VERSION 20131106 #define PHP_HAVE_STREAMS #define YYDEBUG 0 #define PHP_DEFAULT_CHARSET "UTF-8" diff --git a/main/php_content_types.c b/main/php_content_types.c index c8db921..bc42c80 100644 --- a/main/php_content_types.c +++ b/main/php_content_types.c @@ -33,6 +33,19 @@ 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) @@ -42,6 +55,23 @@ 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 e4f26b5..8d3914a 100644 --- a/main/php_globals.h +++ b/main/php_globals.h @@ -135,6 +135,7 @@ 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 0d6e502..52e59ca 100644 --- a/main/php_ini.c +++ b/main/php_ini.c @@ -362,7 +362,7 @@ static void php_load_zend_extension_cb(void *arg TSRMLS_DC) php_size_t length = strlen(filename); if (IS_ABSOLUTE_PATH(filename, length)) { - zend_load_extension(filename TSRMLS_CC); + zend_load_extension(filename); } else { char *libpath; char *extension_dir = INI_STR("extension_dir"); @@ -373,7 +373,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 TSRMLS_CC); + zend_load_extension(libpath); efree(libpath); } } diff --git a/main/php_ticks.c b/main/php_ticks.c index 248b5a9..b07f925 100644 --- a/main/php_ticks.c +++ b/main/php_ticks.c @@ -46,13 +46,17 @@ static int php_compare_tick_functions(void *elem1, void *elem2) return (func1 == func2); } -PHPAPI void php_add_tick_function(void (*func)(int) TSRMLS_DC) +PHPAPI void php_add_tick_function(void (*func)(int)) { + TSRMLS_FETCH(); + zend_llist_add_element(&PG(tick_functions), (void *)&func); } -PHPAPI void php_remove_tick_function(void (*func)(int) TSRMLS_DC) +PHPAPI void php_remove_tick_function(void (*func)(int)) { + TSRMLS_FETCH(); + zend_llist_del_element(&PG(tick_functions), (void *)func, (int(*)(void*, void*))php_compare_tick_functions); } @@ -65,8 +69,10 @@ static void php_tick_iterator(void *data, void *arg TSRMLS_DC) func(*((int *)arg)); } -void php_run_ticks(int count TSRMLS_DC) +void php_run_ticks(int count) { + 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 b511949..0f58ada 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 TSRMLS_DC); +void php_run_ticks(int count); BEGIN_EXTERN_C() -PHPAPI void php_add_tick_function(void (*func)(int) TSRMLS_DC); -PHPAPI void php_remove_tick_function(void (*func)(int) TSRMLS_DC); +PHPAPI void php_add_tick_function(void (*func)(int)); +PHPAPI void php_remove_tick_function(void (*func)(int)); END_EXTERN_C() #endif diff --git a/main/php_variables.c b/main/php_variables.c index 7c13424..8e2671d 100644 --- a/main/php_variables.c +++ b/main/php_variables.c @@ -731,7 +731,6 @@ static zend_bool php_auto_globals_create_post(const char *name, php_size_t name_ 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 87c2e4a..d48bf13 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 7 +#define PHP_MINOR_VERSION 6 #define PHP_RELEASE_VERSION 0 #define PHP_EXTRA_VERSION "-dev" -#define PHP_VERSION "5.7.0-dev" -#define PHP_VERSION_ID 50700 +#define PHP_VERSION "5.6.0-dev" +#define PHP_VERSION_ID 50600