del php-src: NEWS UPGRADING UPGRADING.INTERNALS Zend/zend.c Zend/zend.h Zend/zend_API.c Zend/zend_API.h Zend/zend_alloc .c Zend/zend_alloc.h
Zend/zend_ast.c Zend/zend _execute.h Zend/zend_execute_API.c Zend/zend_ex tensions.c Zend/zend_extensions.h Zend/zend_indent .c Zend/zend_indent.h
Zend/zend_interfaces.c Ze nd/zend_modules.h Zend/zend_object_handlers.c Zen d/zend_vm_def.h Zend/zend_vm_execute.h Zend/zen d_vm_gen.php
Zend/zend_vm_opcodes.h configure

From: Date: Sat, 18 Jan 2014 12:54:11 +0000
Subject: del php-src: NEWS UPGRADING UPGRADING.INTERNALS Zend/zend.c Zend/zend.h Zend/zend_API.c Zend/zend_API.h Zend/zend_alloc .c Zend/zend_alloc.h
Zend/zend_ast.c Zend/zend _execute.h Zend/zend_execute_API.c Zend/zend_ex tensions.c Zend/zend_extensions.h Zend/zend_indent .c Zend/zend_indent.h
Zend/zend_interfaces.c Ze nd/zend_modules.h Zend/zend_object_handlers.c Zen d/zend_vm_def.h Zend/zend_vm_execute.h Zend/zen d_vm_gen.php
Zend/zend_vm_opcodes.h configure
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-75685@lists.php.net to get a copy of this message
Branch: PHP-5.6 Deleted commits count: 271 User: Johannes Schlüter <johannes@php.net> Sat, 18 Jan 2014 12:54:11 +0000 Changed paths: M NEWS M UPGRADING M UPGRADING.INTERNALS M Zend/zend.c M Zend/zend.h M Zend/zend_API.c M Zend/zend_API.h M Zend/zend_alloc.c M Zend/zend_alloc.h M Zend/zend_ast.c M Zend/zend_execute.h M Zend/zend_execute_API.c M Zend/zend_extensions.c M Zend/zend_extensions.h M Zend/zend_indent.c M Zend/zend_indent.h M Zend/zend_interfaces.c M Zend/zend_modules.h M Zend/zend_object_handlers.c M Zend/zend_vm_def.h M Zend/zend_vm_execute.h M Zend/zend_vm_gen.php M Zend/zend_vm_opcodes.h M configure.in M ext/date/lib/parse_date.re M ext/date/lib/parse_iso_intervals.re M ext/dba/dba_inifile.c M ext/dba/libinifile/inifile.c M ext/dba/libinifile/inifile.h D ext/dba/tests/bug62490.phpt M ext/dba/tests/dba_db4_003.phpt M ext/dba/tests/dba_db4_007.phpt A ext/dba/tests/dba_db4_010.phpt M ext/dba/tests/dba_handler.inc M ext/dba/tests/dba_inifile.phpt M ext/dba/tests/dba_tcadb.phpt M ext/dom/php_dom.c M ext/gd/libgd/gdft.c M ext/json/json.c D ext/libxml/tests/libxml_disable_entity_loader.phpt D ext/libxml/tests/libxml_disable_entity_loader_payload.txt M ext/mysqlnd/mysqlnd_net.c M ext/mysqlnd/mysqlnd_ps_codec.c M ext/opcache/Optimizer/block_pass.c M ext/opcache/Optimizer/pass2.c M ext/opcache/ZendAccelerator.c M ext/opcache/ZendAccelerator.h M ext/opcache/zend_accelerator_module.c M ext/opcache/zend_accelerator_module.h M ext/openssl/xp_ssl.c M ext/pcntl/pcntl.c M ext/soap/php_encoding.c M ext/spl/spl_array.c M ext/spl/spl_directory.c M ext/spl/spl_fixedarray.c M ext/spl/spl_iterators.c M ext/standard/array.c M ext/standard/basic_functions.c M ext/standard/ftp_fopen_wrapper.c M ext/standard/http_fopen_wrapper.c M ext/standard/type.c M ext/xsl/php_xsl.c 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 M main/streams/php_stream_context.h M main/streams/streams.c M main/streams/transports.c M main/streams/userspace.c M php.ini-development M php.ini-production M sapi/apache/mod_php5.c M sapi/apache2filter/sapi_apache2.c M sapi/apache2handler/sapi_apache2.c M sapi/apache_hooks/mod_php5.c M sapi/apache_hooks/php_apache.c M sapi/caudium/caudium.c M sapi/cgi/cgi_main.c M sapi/cli/php_cli.c M sapi/cli/php_cli_server.c M sapi/continuity/capi.c M sapi/embed/php_embed..c M sapi/fpm/fpm/fpm_main.c M sapi/litespeed/lsapi_main.c M sapi/litespeed/lsapilib.c M sapi/milter/php_milter.c M sapi/nsapi/nsapi.c M sapi/pi3web/pi3web_sapi.c M sapi/roxen/roxen.c M sapi/thttpd/thttpd.c M sapi/tux/php_tux.c A tests/basic/024.phpt A tests/basic/024_1.phpt A tests/basic/026.phpt A tests/basic/026_1.phpt

diff --git b/NEWS a/NEWS index 904168c..340b3e5 100644 --- b/NEWS +++ a/NEWS @@ -1,11 +1,115 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| -?? ??? 20??, PHP 5.7.0 +?? ??? 20??, PHP 5.6.0 -- DBA: - . Fixed bug #62490 (dba_delete returns true on missing item (inifile)). (Mike) +- CLI server: + . Added some MIME types to the CLI web server. (Chris Jones) -- XSL: - . Fixed bug #64776 (The XSLT extension is not thread safe). (Mike) +- Core: + . Improved IS_VAR operands fetching. (Laruence, Dmitry) + . Improved empty string handling. Now ZE uses an interned string instead of + allocation new empty string each time. (Laruence, Dmitry) + . Implemented internal operator overloading + (RFC: https://wiki.php.net/rfc/operator_overloading_gmp). (Nikita) + . Made calls from incompatible context issue an E_DEPRECATED warning instead + of E_STRICT (phase 1 of RFC: https://wiki.php.net/rfc/incompat_ctx). + (Gustavo) + . Uploads equal or greater than 2GB in size are now accepted. + (Ralf Lang, Mike) + . Reduced POST data memory usage by 200-300%. Changed INI setting + always_populate_raw_post_data to throw a deprecation warning when enabling + and to accept -1 for never populating the $HTTP_RAW_POST_DATA global + variable, which will be the default in future PHP versions. (Mike) + . Implemented dedicated syntax for variadic functions + (RFC: https://wiki.php.net/rfc/variadics). (Nikita) + . Fixed bug #50333 Improving multi-threaded scalability by using + emalloc/efree/estrdup (Anatol, Dmitry) + . Implemented constant scalar expressions (with support for constants) + (RFC: https://wiki.php.net/rfc/const_scalar_exprs). (Bob) + . Fixed bug #65784 (Segfault with finally). (Laruence, Dmitry) + +- cURL: + . Implemented FR #65646 (re-enable CURLOPT_FOLLOWLOCATION with open_basedir + or safe_mode). (Adam) + +- GMP: + . Moved GMP to use object as the underlying structure and implemented various + improvements based on this. + (RFC: https://wiki.php.net/rfc/operator_overloading_gmp). (Nikita) + . Added gmp_root() and gmp_rootrem() functions for calculating nth roots. + (Nikita) + +- Hash: + . Added gost-crypto (CryptoPro S-box) GOST hash algo. (Manuel Mausz) + +- JSON: + . Fixed case part of bug #64874 ("json_decode handles whitespace and + case-sensitivity incorrectly") + +- mysqlnd: + . Disabled flag for SP OUT variables for 5.5+ servers as they are not natively + supported by the overlying APIs. (Andrey) + +- OPcache: + . Added an optimization of class constants and constant calls to some + internal functions (Laruence, Dmitry) + . Added an optimization pass to convert FCALL_BY_NAME into DO_FCALL. + (Laruence, Dmitry) + . Added an optimization pass to merged identical constants (and related + cache_slots) in op_array->literals table. (Laruence, Dmitry) + . Added script level constant replacement optimization pass. (Dmitry) + +- Openssl: + . Added crypto_method option for the ssl stream context. (Martin Jansen) + . Added certificate fingerprint support. (Tjerk Meesters) + . Added explicit TLSv1.1 and TLSv1.2 stream transports. (Daniel Lowrey) + . Fixed bug #65729 (CN_match gives false positive). (Tjerk Meesters) + +- PDO_pgsql: + . Fixed Bug #42614 (PDO_pgsql: add pg_get_notify support). (Matteo) + . Fixed Bug #63657 (pgsqlCopyFromFile, pgsqlCopyToArray use Postgres < 7.3 + syntax). (Matteo) + +- phpdbg: + . Included phpdbg sapi (RFC: https://wiki.php.net/rfc/phpdbg). + (Felipe Pena, Joe Watkins and Bob Weinand) + +- pgsql: + . pg_version() returns full report which obtained by PQparameterStatus(). + (Yasuo) + . Added pg_lo_truncate(). (Yasuo) + . Added 64bit large object support for PostgreSQL 9.3 and later. (Yasuo) + +- Session: + . Fixed Bug #65315 (session.hash_function silently fallback to default md5) + (Yasuo) + . Implemented Request #54649 (Create session_serializer_name()). (Yasuo) + . Implemented Request #17860 (Session write short circuit). (Yasuo) + . Implemented Request #20421 (session_abort() and session_reset() function). + (Yasuo) + . Implemented Request #11100 (session_gc() function). (Yasuo) + +- Standard: + . Implemented FR #65634 (HTTP wrapper is very slow with protocol_version + 1.1). (Adam) + . Implemented Change crypt() behavior w/o salt RFC. (Yasuo) + https://wiki.php.net/rfc/crypt_function_salt + . Implemented request #49824 (Change array_fill() to allow creating empty + array). (Nikita) + +- XMLReader: + . Fixed bug #55285 (XMLReader::getAttribute/No/Ns methods inconsistency). + (Mike) + +- Zip: + . update libzip to version 1.11.2. + PHP don't use any ilibzip private symbol anymore. (Pierre, Remi) + . new method ZipArchive::setPassword($password). (Pierre) + . add --with-libzip option to build with system libzip. (Remi) + . new methods: + ZipArchive::setExternalAttributesName($name, $opsys, $attr [, $flags]) + ZipArchive::setExternalAttributesIndex($idx, $opsys, $attr [, $flags]) + ZipArchive::getExternalAttributesName($name, &$opsys, &$attr [, $flags]) + ZipArchive::getExternalAttributesIndex($idx, &$opsys, &$attr [, $flags]) <<< NOTE: Insert NEWS from last stable release here prior to actual release! >>> diff --git b/UPGRADING a/UPGRADING index f5e36fe..8f83b51 100755 --- b/UPGRADING +++ a/UPGRADING @@ -20,34 +20,86 @@ PHP X.Y UPGRADE NOTES 1. Backward Incompatible Changes ======================================== -- DBA - . dba_delete() now returns false if the key was not found for the inifile - handler, too. +- JSON: + json_decode() no longer accepts non-lowercase variants of lone JSON true, + false or null values. For example, True or FALSE will now cause json_decode to + return NULL and set an error value you can fetch with json_last_error(). + This affects JSON texts consisting solely of true, false or null. Text + containing non-lowercase values inside JSON arrays or objects has never been + accepted. ======================================== 2. New Features ======================================== +- Added constant scalar expressions syntax + (https://wiki.php.net/rfc/const_scalar_exprs) + +- Added dedicated syntax for variadic functions. + (https://wiki.php.net/rfc/variadics) + +- Added support for argument unpacking to complement the variadic syntax. + (https://wiki.php.net/rfc/argument_unpacking) + +- The php://input stream is now re-usable and can be used concurrently with + enable_post_data_reading=0. + +- Added gost-crypto (CryptoPro S-box) hash algo. + +- Added openssl certificate fingerprint support (inclusive stream context + option). + +- Added openssl crypto method stream context option. + +- Added use function and use const. + (https://wiki.php.net/rfc/use_function) ======================================== 2. Changes in SAPI modules ======================================== +- Added phpdbg sapi. + (https://wiki.php.net/rfc/phpdbg) ======================================== 3. Deprecated Functionality ======================================== +- Incompatible context calls: + Instance calls from an incompatible context are now deprecated and issue + E_DEPRECATED instead of E_STRICT. See https://wiki.php.net/rfc/incompat_ctx ======================================== 4. Changed Functions ======================================== +- cURL: + CURLOPT_SAFE_UPLOAD is now turned on by default and uploads with @file + do not work unless it is explicitly set to false. + +- Crypt: + crypt() will now raise an E_NOTICE error if the salt parameter is omitted. + See: https://wiki.php.net/rfc/crypt_function_salt + +- XMLReader: + XMLReader::getAttributeNs and XMLReader::getAttributeNo now return NULL if + the attribute could not be found, just like XMLReader::getAttribute. ======================================== 5. New Functions ======================================== +- GMP: + Added gmp_root($a, $nth) and gmp_rootrem($a, $nth) for calculating nth roots. + +- Openssl: + Added string openssl_x509_fingerprint($x509, $type, $binary). + +- LDAP: + Added ldap_escape($value, $ignore = "", $flags = 0). + +- Zip: + Added ZipArchive::setPassword($password) ======================================== 6. New Classes and Interfaces @@ -63,18 +115,50 @@ PHP X.Y UPGRADE NOTES 8. Other Changes to Extensions ======================================== +- GMP: + The GMP extension now uses objects as the underlying data structure, rather + than resources. GMP instances now support dumping, serialization, cloning, + casts to primitive types and have overloaded operators. + (RFC: https://wiki.php.net/rfc/operator_overloading_gmp) + +- OCI8: + - Added Implicit Result Set support for Oracle Database 12c with a + new oci_get_implicit_resultset() function. + - Using 'oci_execute($s, OCI_NO_AUTO_COMMIT)' for a SELECT no longer + unnecessarily initiates an internal ROLLBACK during connection + close. + - Added DTrace probes enabled with PHP's generic --enable-dtrace + - The oci_internal_debug() function is now a no-op. + - The phpinfo() output format for OCI8 has changed. ======================================== 9. New Global Constants ======================================== +- LDAP: + LDAP_ESCAPE_FILTER int(1) + LDAP_ESCAPE_DN int(2) ======================================== 10. Changes to INI File Handling ======================================== +- Core: + Changed always_populate_raw_post_data to throw a deprecation warning when + enabled and to recognize ohe value -1 for never populating the global + $HTTP_RAW_POST_DATA variable, which will be default in future PHP versions. ======================================== 11. Other Changes ======================================== +- File upload: + Uploads equal or greater than 2GB in size are now accepted. + +- HTTP stream wrapper: + HTTP 1.1 requests now include a Connection: close header unless explicitly + overridden by setting a Connection header via the header context option. + +- Zip: + New --with-libzip option allow to use system libzip. Version > 0.11 required, + Version >= 0.11.2 recommended for all features. diff --git b/UPGRADING.INTERNALS a/UPGRADING.INTERNALS index 97b281a..d1aca29 100644 --- b/UPGRADING.INTERNALS +++ a/UPGRADING.INTERNALS @@ -17,11 +17,108 @@ UPGRADE NOTES - PHP X.Y 1. Internal API changes ======================== - a. zend_set_memory_limit() now takes the TSRMLS_CC macro as its last argument + a. Addition of do_operation and compare object handlers + + Two new object handlers have been added: + + do_operation: + typedef int (*zend_object_do_operation_t)( + zend_uchar opcode, zval *result, zval *op1, zval *op2 TSRMLS_DC + ); + + compare: + typedef int (*zend_object_compare_zvals_t)( + zval *result, zval *op1, zval *op2 TSRMLS_DC + ); + The first handler is used to overload arithmetic operations. The first + argument specifies the opcode of the operator, result is the target zval, + op1 the first operand and op2 the second operand. For unary operations + op2 is NULL. If the handler returns FAILURE PHP falls back to the default + behavior for the operation. + + The second handler is used to perform comparison operations with + non-objects. The value written into result must be an IS_LONG with value + -1 (smaller), 0 (equal) or 1 (greater). The return value is a SUCCESS/FAILURE + return code. The difference between this handler and compare_objects is + that it will be triggered for comparisons with non-objects and objects of + different types. It takes precedence over compare_objects. + + Further docs in the RFC: https://wiki.php.net/rfc/operator_overloading_gmp + + b. return_value_ptr now always available, RETVAL_ZVAL_FAST macros + + The return_value_ptr argument to internal functions is now always set. + Previously it was only available for functions returning by-reference. + return_value_ptr can now be used to return zvals without copying them. + For this purpose two new macros are provided: + + RETVAL_ZVAL_FAST(zv); /* analog to RETVAL_ZVAL(zv, 1, 0) */ + RETURN_ZVAL_FAST(zv); /* analog to RETURN_ZVAL(zv, 1, 0) */ + + The macros behave similarly to the non-FAST variants with copy=1 and + dtor=0, but will try to return the zval without making a copy by utilizing + return_value_ptr. + + c. POST data handling + + The sapi_request_info's members post_data, post_data_len and raw_post_data as + well as raw_post_data_len have been replaced with a temp PHP stream + request_body. + + The recommended way to access raw POST data is to open and use a php://input + stream wrapper. It is safe to be used concurrently and more than once. + + d. Arginfo changes + + The pass_rest_by_reference argument of the ZEND_BEGIN_ARG_INFO and + ZEND_BEGIN_ARG_INFO_EX() is no longer used. The value passed to it is ignored. + + Instead a variadic argument is created using ZEND_ARG_VARIADIC_INFO(): + + ZEND_ARG_VARIADIC_INFO(0, name) /* pass rest by value */ + ZEND_ARG_VARIADIC_INFO(1, name) /* pass rest by reference */ + ZEND_ARG_VARIADIC_INFO(ZEND_SEND_PREFER_REF, name) + /* pass rest by prefer-ref */ + + ZEND_ARG_VARIADIC_INFO() should only be used for the last argument. + + The following changes were applied to the zend_arg_info struct: + + typedef struct _zend_arg_info { + const char *class_name; + zend_uint class_name_len; + zend_uchar type_hint; + + zend_uchar pass_by_reference; + zend_bool allow_null; + - zend_bool pass_by_reference; + + zend_bool is_variadic; + } zend_arg_info; + + The following changes were applied to the zend_internal_function_info struct: + + typedef struct _zend_internal_function_info { + zend_uint required_num_args; + zend_uchar _type_hint; + zend_bool return_reference; + - zend_bool pass_rest_by_reference; + + zend_bool _allow_null; + + zend_bool _is_variadic; + } zend_internal_function_info; + + The CHECK_ARG_SEND_TYPE(), ARG_MUST_BE_SENT_BY_REF(), + ARG_SHOULD_BE_SENT_BY_REF() and ARG_MAY_BE_SENT_BY_REF() macros now assume + that the argument passed to them is a zend_function* and that it is non-NULL. ======================== 2. Build system changes ======================== + a. Unix build system changes + - The bison version check is now a blacklist instead of a whitelist. + - The bison binary can be specified through the YACC environment/configure + variable. Previously `bison` was assumed to be in $PATH. + + b. Windows build system changes + - diff --git b/Zend/zend.c a/Zend/zend.c index acbbcbe..ce11631 100644 --- b/Zend/zend.c +++ a/Zend/zend.c @@ -52,7 +52,7 @@ ZEND_API FILE *(*zend_fopen)(const char *filename, char **opened_path TSRMLS_DC) ZEND_API int (*zend_stream_open_function)(const char *filename, zend_file_handle *handle TSRMLS_DC); ZEND_API void (*zend_block_interruptions)(void); ZEND_API void (*zend_unblock_interruptions)(void); -ZEND_API void (*zend_ticks_function)(int ticks TSRMLS_DC); +ZEND_API void (*zend_ticks_function)(int ticks); ZEND_API void (*zend_error_cb)(int type, const char *error_filename, const uint error_lineno, const char *format, va_list args); int (*zend_vspprintf)(char **pbuf, size_t max_len, const char *format, va_list ap); ZEND_API char *(*zend_getenv)(char *name, size_t name_len TSRMLS_DC); diff --git b/Zend/zend.h a/Zend/zend.h index c8b57cd..ac2b28a 100644 --- b/Zend/zend.h +++ a/Zend/zend.h @@ -22,7 +22,7 @@ #ifndef ZEND_H #define ZEND_H -#define ZEND_VERSION "2.7.0-dev" +#define ZEND_VERSION "2.6.0-dev" #define ZEND_ENGINE_2 @@ -550,7 +550,7 @@ typedef struct _zend_utility_functions { void (*block_interruptions)(void); void (*unblock_interruptions)(void); int (*get_configuration_directive)(const char *name, uint name_length, zval *contents); - void (*ticks_function)(int ticks TSRMLS_DC); + void (*ticks_function)(int ticks); void (*on_timeout)(int seconds TSRMLS_DC); int (*stream_open_function)(const char *filename, zend_file_handle *handle TSRMLS_DC); int (*vspprintf_function)(char **pbuf, size_t max_len, const char *format, va_list ap); @@ -702,7 +702,7 @@ extern ZEND_API zend_write_func_t zend_write; extern ZEND_API FILE *(*zend_fopen)(const char *filename, char **opened_path TSRMLS_DC); extern ZEND_API void (*zend_block_interruptions)(void); extern ZEND_API void (*zend_unblock_interruptions)(void); -extern ZEND_API void (*zend_ticks_function)(int ticks TSRMLS_DC); +extern ZEND_API void (*zend_ticks_function)(int ticks); extern ZEND_API void (*zend_error_cb)(int type, const char *error_filename, const uint error_lineno, const char *format, va_list args) ZEND_ATTRIBUTE_PTR_FORMAT(printf, 4, 0); extern ZEND_API void (*zend_on_timeout)(int seconds TSRMLS_DC); extern ZEND_API int (*zend_stream_open_function)(const char *filename, zend_file_handle *handle TSRMLS_DC); diff --git b/Zend/zend_API.c a/Zend/zend_API.c index 553060e..c17af98 100644 --- b/Zend/zend_API.c +++ a/Zend/zend_API.c @@ -2313,8 +2313,10 @@ ZEND_API void zend_unregister_functions(const zend_function_entry *functions, in } /* }}} */ -ZEND_API int zend_startup_module(zend_module_entry *module TSRMLS_DC) /* {{{ */ +ZEND_API int zend_startup_module(zend_module_entry *module) /* {{{ */ { + TSRMLS_FETCH(); + if ((module = zend_register_internal_module(module TSRMLS_CC)) != NULL && zend_startup_module_ex(module TSRMLS_CC) == SUCCESS) { return SUCCESS; } diff --git b/Zend/zend_API.h a/Zend/zend_API.h index 569407b..0a7695b 100644 --- b/Zend/zend_API.h +++ a/Zend/zend_API.h @@ -266,7 +266,7 @@ ZEND_API int zend_parse_parameter(int flags, int arg_num TSRMLS_DC, zval **arg, ZEND_API int zend_register_functions(zend_class_entry *scope, const zend_function_entry *functions, HashTable *function_table, int type TSRMLS_DC); ZEND_API void zend_unregister_functions(const zend_function_entry *functions, int count, HashTable *function_table TSRMLS_DC); -ZEND_API int zend_startup_module(zend_module_entry *module_entry TSRMLS_DC); +ZEND_API int zend_startup_module(zend_module_entry *module_entry); ZEND_API zend_module_entry* zend_register_internal_module(zend_module_entry *module_entry TSRMLS_DC); ZEND_API zend_module_entry* zend_register_module_ex(zend_module_entry *module TSRMLS_DC); ZEND_API int zend_startup_module_ex(zend_module_entry *module TSRMLS_DC); diff --git b/Zend/zend_alloc.c a/Zend/zend_alloc.c index f621487..bdcee5c 100644 --- b/Zend/zend_alloc.c +++ a/Zend/zend_alloc.c @@ -2682,8 +2682,10 @@ ZEND_API char *zend_strndup(const char *s, uint length) } -ZEND_API int zend_set_memory_limit(size_t memory_limit TSRMLS_DC) +ZEND_API int zend_set_memory_limit(size_t memory_limit) { + TSRMLS_FETCH(); + AG(mm_heap)->limit = (memory_limit >= AG(mm_heap)->block_size) ? memory_limit : AG(mm_heap)->block_size; return SUCCESS; diff --git b/Zend/zend_alloc.h a/Zend/zend_alloc.h index 1541dff..05494ee 100644 --- b/Zend/zend_alloc.h +++ a/Zend/zend_alloc.h @@ -139,7 +139,7 @@ inline static void * __zend_realloc(void *p, size_t len) #define safe_estrdup(ptr) ((ptr)?(estrdup(ptr)):STR_EMPTY_ALLOC()) #define safe_estrndup(ptr, len) ((ptr)?(estrndup((ptr), (len))):STR_EMPTY_ALLOC()) -ZEND_API int zend_set_memory_limit(size_t memory_limit TSRMLS_DC); +ZEND_API int zend_set_memory_limit(size_t memory_limit); ZEND_API void start_memory_manager(TSRMLS_D); ZEND_API void shutdown_memory_manager(int silent, int full_shutdown TSRMLS_DC); diff --git b/Zend/zend_ast.c a/Zend/zend_ast.c index 49fd3ff..cf595b4 100644 --- b/Zend/zend_ast.c +++ a/Zend/zend_ast.c @@ -231,9 +231,9 @@ ZEND_API void zend_ast_evaluate(zval *result, zend_ast *ast, zend_class_entry *s break; case ZEND_BOOL_AND: zend_ast_evaluate(&op1, (&ast->u.child)[0], scope TSRMLS_CC); - if (zend_is_true(&op1 TSRMLS_CC)) { + if (zend_is_true(&op1)) { zend_ast_evaluate(&op2, (&ast->u.child)[1], scope TSRMLS_CC); - ZVAL_BOOL(result, zend_is_true(&op2 TSRMLS_CC)); + ZVAL_BOOL(result, zend_is_true(&op2)); zval_dtor(&op2); } else { ZVAL_BOOL(result, 0); @@ -242,18 +242,18 @@ ZEND_API void zend_ast_evaluate(zval *result, zend_ast *ast, zend_class_entry *s break; case ZEND_BOOL_OR: zend_ast_evaluate(&op1, (&ast->u.child)[0], scope TSRMLS_CC); - if (zend_is_true(&op1 TSRMLS_CC)) { + if (zend_is_true(&op1)) { ZVAL_BOOL(result, 1); } else { zend_ast_evaluate(&op2, (&ast->u.child)[1], scope TSRMLS_CC); - ZVAL_BOOL(result, zend_is_true(&op2 TSRMLS_CC)); + ZVAL_BOOL(result, zend_is_true(&op2)); zval_dtor(&op2); } zval_dtor(&op1); break; case ZEND_SELECT: zend_ast_evaluate(&op1, (&ast->u.child)[0], scope TSRMLS_CC); - if (zend_is_true(&op1 TSRMLS_CC)) { + if (zend_is_true(&op1)) { if (!(&ast->u.child)[1]) { *result = op1; } else { diff --git b/Zend/zend_execute.h a/Zend/zend_execute.h index e79b945..0d3a908 100644 --- b/Zend/zend_execute.h +++ a/Zend/zend_execute.h @@ -60,7 +60,7 @@ ZEND_API zend_execute_data *zend_create_execute_data_from_op_array(zend_op_array ZEND_API void zend_execute(zend_op_array *op_array TSRMLS_DC); ZEND_API void execute_ex(zend_execute_data *execute_data TSRMLS_DC); ZEND_API void execute_internal(zend_execute_data *execute_data_ptr, struct _zend_fcall_info *fci, int return_value_used TSRMLS_DC); -ZEND_API int zend_is_true(zval *op TSRMLS_DC); +ZEND_API int zend_is_true(zval *op); ZEND_API int zend_lookup_class(const char *name, int name_length, zend_class_entry ***ce TSRMLS_DC); ZEND_API int zend_lookup_class_ex(const char *name, int name_length, const zend_literal *key, int use_autoload, zend_class_entry ***ce TSRMLS_DC); ZEND_API int zend_eval_string(char *str, zval *retval_ptr, char *string_name TSRMLS_DC); @@ -101,7 +101,7 @@ static zend_always_inline void i_zval_ptr_dtor_nogc(zval *zval_ptr ZEND_FILE_LIN } } -static zend_always_inline int i_zend_is_true(zval *op TSRMLS_DC) +static zend_always_inline int i_zend_is_true(zval *op) { int result; @@ -130,6 +130,8 @@ static zend_always_inline int i_zend_is_true(zval *op TSRMLS_DC) break; case IS_OBJECT: if(IS_ZEND_STD_OBJECT(*op)) { + TSRMLS_FETCH(); + if (Z_OBJ_HT_P(op)->cast_object) { zval tmp; if (Z_OBJ_HT_P(op)->cast_object(op, &tmp, IS_BOOL TSRMLS_CC) == SUCCESS) { diff --git b/Zend/zend_execute_API.c a/Zend/zend_execute_API.c index 3988074..5d5153d 100644 --- b/Zend/zend_execute_API.c +++ a/Zend/zend_execute_API.c @@ -443,9 +443,9 @@ ZEND_API void _zval_internal_ptr_dtor(zval **zval_ptr ZEND_FILE_LINE_DC) /* {{{ } /* }}} */ -ZEND_API int zend_is_true(zval *op TSRMLS_DC) /* {{{ */ +ZEND_API int zend_is_true(zval *op) /* {{{ */ { - return i_zend_is_true(op TSRMLS_CC); + return i_zend_is_true(op); } /* }}} */ diff --git b/Zend/zend_extensions.c a/Zend/zend_extensions.c index 4728434..e1290b7 100644 --- b/Zend/zend_extensions.c +++ a/Zend/zend_extensions.c @@ -24,7 +24,7 @@ ZEND_API zend_llist zend_extensions; static int last_resource_number; -int zend_load_extension(const char *path TSRMLS_DC) +int zend_load_extension(const char *path) { #if ZEND_EXTENSIONS_SUPPORT DL_HANDLE handle; @@ -107,7 +107,7 @@ int zend_load_extension(const char *path TSRMLS_DC) return FAILURE; } - return zend_register_extension(new_extension, handle TSRMLS_CC); + return zend_register_extension(new_extension, handle); #else fprintf(stderr, "Extensions are not supported on this platform.\n"); /* See http://support.microsoft.com/kb/190351 */ @@ -119,7 +119,7 @@ int zend_load_extension(const char *path TSRMLS_DC) } -int zend_register_extension(zend_extension *new_extension, DL_HANDLE handle TSRMLS_DC) +int zend_register_extension(zend_extension *new_extension, DL_HANDLE handle) { #if ZEND_EXTENSIONS_SUPPORT zend_extension extension; @@ -127,7 +127,7 @@ int zend_register_extension(zend_extension *new_extension, DL_HANDLE handle TSRM extension = *new_extension; extension.handle = handle; - zend_extension_dispatch_message(ZEND_EXTMSG_NEW_EXTENSION, &extension TSRMLS_CC); + zend_extension_dispatch_message(ZEND_EXTMSG_NEW_EXTENSION, &extension); zend_llist_add_element(&zend_extensions, &extension); @@ -208,8 +208,10 @@ static void zend_extension_message_dispatcher(const zend_extension *extension, i } -ZEND_API void zend_extension_dispatch_message(int message, void *arg TSRMLS_DC) +ZEND_API void zend_extension_dispatch_message(int message, void *arg) { + TSRMLS_FETCH(); + zend_llist_apply_with_arguments(&zend_extensions, (llist_apply_with_args_func_t) zend_extension_message_dispatcher TSRMLS_CC, 2, message, arg); } diff --git b/Zend/zend_extensions.h a/Zend/zend_extensions.h index 38ac9f8..3eda38a 100644 --- b/Zend/zend_extensions.h +++ a/Zend/zend_extensions.h @@ -28,7 +28,7 @@ /* The first number is the engine version and the rest is the date. * This way engine 2/3 API no. is always greater than engine 1 API no.. */ -#define ZEND_EXTENSION_API_NO 220131227 +#define ZEND_EXTENSION_API_NO 220131226 typedef struct _zend_extension_version_info { int zend_extension_api_no; @@ -94,7 +94,7 @@ struct _zend_extension { BEGIN_EXTERN_C() ZEND_API int zend_get_resource_handle(zend_extension *extension); -ZEND_API void zend_extension_dispatch_message(int message, void *arg TSRMLS_DC); +ZEND_API void zend_extension_dispatch_message(int message, void *arg); END_EXTERN_C() #define ZEND_EXTMSG_NEW_EXTENSION 1 @@ -117,8 +117,8 @@ int zend_startup_extensions(void); void zend_shutdown_extensions(TSRMLS_D); BEGIN_EXTERN_C() -ZEND_API int zend_load_extension(const char *path TSRMLS_DC); -ZEND_API int zend_register_extension(zend_extension *new_extension, DL_HANDLE handle TSRMLS_DC); +ZEND_API int zend_load_extension(const char *path); +ZEND_API int zend_register_extension(zend_extension *new_extension, DL_HANDLE handle); ZEND_API zend_extension *zend_get_extension(const char *extension_name); END_EXTERN_C() diff --git b/Zend/zend_indent.c a/Zend/zend_indent.c index 38ce669..cacdf8d 100644 --- b/Zend/zend_indent.c +++ a/Zend/zend_indent.c @@ -47,7 +47,7 @@ static void handle_whitespace(int *emit_whitespace) } -ZEND_API void zend_indent(TSRMLS_D) +ZEND_API void zend_indent() { zval token; int token_type; @@ -55,6 +55,7 @@ ZEND_API void zend_indent(TSRMLS_D) int nest_level=0; int emit_whitespace[256]; int i; + TSRMLS_FETCH(); memset(emit_whitespace, 0, sizeof(int)*256); diff --git b/Zend/zend_indent.h a/Zend/zend_indent.h index 1c1afb9..6d0996e 100644 --- b/Zend/zend_indent.h +++ a/Zend/zend_indent.h @@ -23,7 +23,7 @@ #define ZEND_INDENT_H BEGIN_EXTERN_C() -ZEND_API void zend_indent(TSRMLS_D); +ZEND_API void zend_indent(void); END_EXTERN_C() #endif /* ZEND_INDENT_H */ diff --git b/Zend/zend_interfaces.c a/Zend/zend_interfaces.c index f9a020c..4b01eb3 100644 --- b/Zend/zend_interfaces.c +++ a/Zend/zend_interfaces.c @@ -162,7 +162,7 @@ ZEND_API int zend_user_it_valid(zend_object_iterator *_iter TSRMLS_DC) zend_call_method_with_0_params(&object, iter->ce, &iter->ce->iterator_funcs.zf_valid, "valid", &more); if (more) { - result = i_zend_is_true(more TSRMLS_CC); + result = i_zend_is_true(more); zval_ptr_dtor(&more); return result ? SUCCESS : FAILURE; } diff --git b/Zend/zend_modules.h a/Zend/zend_modules.h index 55f99c4..080d461 100644 --- b/Zend/zend_modules.h +++ a/Zend/zend_modules.h @@ -33,7 +33,7 @@ #define ZEND_MODULE_INFO_FUNC_ARGS zend_module_entry *zend_module TSRMLS_DC #define ZEND_MODULE_INFO_FUNC_ARGS_PASSTHRU zend_module TSRMLS_CC -#define ZEND_MODULE_API_NO 20131227 +#define ZEND_MODULE_API_NO 20131226 #ifdef ZTS #define USING_ZTS 1 #else diff --git b/Zend/zend_object_handlers.c a/Zend/zend_object_handlers.c index 0af8e27..991dca2 100644 --- b/Zend/zend_object_handlers.c +++ a/Zend/zend_object_handlers.c @@ -29,7 +29,6 @@ #include "zend_interfaces.h" #include "zend_closures.h" #include "zend_compile.h" -#include "zend_hash.h" #define DEBUG_OBJECT_HANDLERS 0 @@ -189,7 +188,7 @@ static int zend_std_call_setter(zval *object, zval *member, zval *value TSRMLS_D zval_ptr_dtor(&value); if (retval) { - result = i_zend_is_true(retval TSRMLS_CC) ? SUCCESS : FAILURE; + result = i_zend_is_true(retval) ? SUCCESS : FAILURE; zval_ptr_dtor(&retval); return result; } else { @@ -694,12 +693,12 @@ static int zend_std_has_dimension(zval *object, zval *offset, int check_empty TS SEPARATE_ARG_IF_REF(offset); zend_call_method_with_1_params(&object, ce, NULL, "offsetexists", &retval, offset); if (EXPECTED(retval != NULL)) { - result = i_zend_is_true(retval TSRMLS_CC); + result = i_zend_is_true(retval); zval_ptr_dtor(&retval); if (check_empty && result && EXPECTED(!EG(exception))) { zend_call_method_with_1_params(&object, ce, NULL, "offsetget", &retval, offset); if (retval) { - result = i_zend_is_true(retval TSRMLS_CC); + result = i_zend_is_true(retval); zval_ptr_dtor(&retval); } } @@ -1443,7 +1442,7 @@ static int zend_std_has_property(zval *object, zval *member, int has_set_exists, guard->in_isset = 1; /* prevent circular getting */ rv = zend_std_call_issetter(object, member TSRMLS_CC); if (rv) { - result = zend_is_true(rv TSRMLS_CC); + result = zend_is_true(rv); zval_ptr_dtor(&rv); if (has_set_exists && result) { if (EXPECTED(!EG(exception)) && zobj->ce->__get && !guard->in_get) { @@ -1452,7 +1451,7 @@ static int zend_std_has_property(zval *object, zval *member, int has_set_exists, guard->in_get = 0; if (rv) { Z_ADDREF_P(rv); - result = i_zend_is_true(rv TSRMLS_CC); + result = i_zend_is_true(rv); zval_ptr_dtor(&rv); } else { result = 0; @@ -1471,7 +1470,7 @@ static int zend_std_has_property(zval *object, zval *member, int has_set_exists, result = (Z_TYPE_PP(value) != IS_NULL); break; default: - result = zend_is_true(*value TSRMLS_CC); + result = zend_is_true(*value); break; case 2: result = 1; diff --git b/Zend/zend_vm_def.h a/Zend/zend_vm_def.h index a12f16d..37af82c 100644 --- b/Zend/zend_vm_def.h +++ a/Zend/zend_vm_def.h @@ -2100,7 +2100,7 @@ ZEND_VM_HANDLER(43, ZEND_JMPZ, CONST|TMP|VAR|CV, ANY) if (OP1_TYPE == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) { ret = Z_LVAL_P(val); } else { - ret = i_zend_is_true(val TSRMLS_CC); + ret = i_zend_is_true(val); FREE_OP1(); if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); @@ -2130,7 +2130,7 @@ ZEND_VM_HANDLER(44, ZEND_JMPNZ, CONST|TMP|VAR|CV, ANY) if (OP1_TYPE == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) { ret = Z_LVAL_P(val); } else { - ret = i_zend_is_true(val TSRMLS_CC); + ret = i_zend_is_true(val); FREE_OP1(); if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); @@ -2160,7 +2160,7 @@ ZEND_VM_HANDLER(45, ZEND_JMPZNZ, CONST|TMP|VAR|CV, ANY) if (OP1_TYPE == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) { retval = Z_LVAL_P(val); } else { - retval = i_zend_is_true(val TSRMLS_CC); + retval = i_zend_is_true(val); FREE_OP1(); if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); @@ -2194,7 +2194,7 @@ ZEND_VM_HANDLER(46, ZEND_JMPZ_EX, CONST|TMP|VAR|CV, ANY) if (OP1_TYPE == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) { retval = Z_LVAL_P(val); } else { - retval = i_zend_is_true(val TSRMLS_CC); + retval = i_zend_is_true(val); FREE_OP1(); if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); @@ -2225,7 +2225,7 @@ ZEND_VM_HANDLER(47, ZEND_JMPNZ_EX, CONST|TMP|VAR|CV, ANY) if (OP1_TYPE == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) { retval = Z_LVAL_P(val); } else { - retval = i_zend_is_true(val TSRMLS_CC); + retval = i_zend_is_true(val); FREE_OP1(); if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); @@ -3480,7 +3480,7 @@ ZEND_VM_HANDLER(52, ZEND_BOOL, CONST|TMP|VAR|CV, ANY) SAVE_OPLINE(); /* PHP 3.0 returned "" for false and 1 for true, here we use 0 and 1 for now */ - ZVAL_BOOL(retval, i_zend_is_true(GET_OP1_ZVAL_PTR(BP_VAR_R) TSRMLS_CC)); + ZVAL_BOOL(retval, i_zend_is_true(GET_OP1_ZVAL_PTR(BP_VAR_R))); FREE_OP1(); CHECK_EXCEPTION(); @@ -4643,7 +4643,7 @@ ZEND_VM_HANDLER(114, ZEND_ISSET_ISEMPTY_VAR, CONST|TMP|VAR|CV, UNUSED|CONST|VAR) ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 0); } } else /* if (opline->extended_value & ZEND_ISEMPTY) */ { - if (!isset || !i_zend_is_true(*value TSRMLS_CC)) { + if (!isset || !i_zend_is_true(*value)) { ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 1); } else { ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 0); @@ -4715,7 +4715,7 @@ ZEND_VM_C_LABEL(num_index_prop): result = isset; } } else /* if (opline->extended_value & ZEND_ISEMPTY) */ { - if (!isset || !i_zend_is_true(*value TSRMLS_CC)) { + if (!isset || !i_zend_is_true(*value)) { result = 0; } else { result = 1; @@ -4909,7 +4909,7 @@ ZEND_VM_HANDLER(152, ZEND_JMP_SET, CONST|TMP|VAR|CV, ANY) SAVE_OPLINE(); value = GET_OP1_ZVAL_PTR(BP_VAR_R); - if (i_zend_is_true(value TSRMLS_CC)) { + if (i_zend_is_true(value)) { ZVAL_COPY_VALUE(&EX_T(opline->result.var).tmp_var, value); if (!IS_OP1_TMP_FREE()) { zendi_zval_copy_ctor(EX_T(opline->result.var).tmp_var); @@ -4935,7 +4935,7 @@ ZEND_VM_HANDLER(158, ZEND_JMP_SET_VAR, CONST|TMP|VAR|CV, ANY) SAVE_OPLINE(); value = GET_OP1_ZVAL_PTR(BP_VAR_R); - if (i_zend_is_true(value TSRMLS_CC)) { + if (i_zend_is_true(value)) { if (OP1_TYPE == IS_VAR || OP1_TYPE == IS_CV) { Z_ADDREF_P(value); EX_T(opline->result.var).var.ptr = value; @@ -5090,7 +5090,7 @@ ZEND_VM_HANDLER(105, ZEND_TICKS, ANY, ANY) if (++EG(ticks_count)>=opline->extended_value) { EG(ticks_count)=0; if (zend_ticks_function) { - zend_ticks_function(opline->extended_value TSRMLS_CC); + zend_ticks_function(opline->extended_value); } } CHECK_EXCEPTION(); diff --git b/Zend/zend_vm_execute.h a/Zend/zend_vm_execute.h index 32eec74..0651389 100644 --- b/Zend/zend_vm_execute.h +++ a/Zend/zend_vm_execute.h @@ -1103,7 +1103,7 @@ static int ZEND_FASTCALL ZEND_TICKS_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) if (++EG(ticks_count)>=opline->extended_value) { EG(ticks_count)=0; if (zend_ticks_function) { - zend_ticks_function(opline->extended_value TSRMLS_CC); + zend_ticks_function(opline->extended_value); } } CHECK_EXCEPTION(); @@ -2412,7 +2412,7 @@ static int ZEND_FASTCALL ZEND_JMPZ_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) if (IS_CONST == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) { ret = Z_LVAL_P(val); } else { - ret = i_zend_is_true(val TSRMLS_CC); + ret = i_zend_is_true(val); if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); @@ -2442,7 +2442,7 @@ static int ZEND_FASTCALL ZEND_JMPNZ_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS if (IS_CONST == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) { ret = Z_LVAL_P(val); } else { - ret = i_zend_is_true(val TSRMLS_CC); + ret = i_zend_is_true(val); if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); @@ -2472,7 +2472,7 @@ static int ZEND_FASTCALL ZEND_JMPZNZ_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARG if (IS_CONST == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) { retval = Z_LVAL_P(val); } else { - retval = i_zend_is_true(val TSRMLS_CC); + retval = i_zend_is_true(val); if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); @@ -2506,7 +2506,7 @@ static int ZEND_FASTCALL ZEND_JMPZ_EX_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_AR if (IS_CONST == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) { retval = Z_LVAL_P(val); } else { - retval = i_zend_is_true(val TSRMLS_CC); + retval = i_zend_is_true(val); if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); @@ -2537,7 +2537,7 @@ static int ZEND_FASTCALL ZEND_JMPNZ_EX_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_A if (IS_CONST == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) { retval = Z_LVAL_P(val); } else { - retval = i_zend_is_true(val TSRMLS_CC); + retval = i_zend_is_true(val); if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); @@ -2765,7 +2765,7 @@ static int ZEND_FASTCALL ZEND_BOOL_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) SAVE_OPLINE(); /* PHP 3.0 returned "" for false and 1 for true, here we use 0 and 1 for now */ - ZVAL_BOOL(retval, i_zend_is_true(opline->op1.zv TSRMLS_CC)); + ZVAL_BOOL(retval, i_zend_is_true(opline->op1.zv)); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -3222,7 +3222,7 @@ static int ZEND_FASTCALL ZEND_JMP_SET_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_AR SAVE_OPLINE(); value = opline->op1.zv; - if (i_zend_is_true(value TSRMLS_CC)) { + if (i_zend_is_true(value)) { ZVAL_COPY_VALUE(&EX_T(opline->result.var).tmp_var, value); if (!0) { zendi_zval_copy_ctor(EX_T(opline->result.var).tmp_var); @@ -3247,7 +3247,7 @@ static int ZEND_FASTCALL ZEND_JMP_SET_VAR_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLE SAVE_OPLINE(); value = opline->op1.zv; - if (i_zend_is_true(value TSRMLS_CC)) { + if (i_zend_is_true(value)) { if (IS_CONST == IS_VAR || IS_CONST == IS_CV) { Z_ADDREF_P(value); EX_T(opline->result.var).var.ptr = value; @@ -4278,7 +4278,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CONST_CONST_HANDLER(ZEND_O ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 0); } } else /* if (opline->extended_value & ZEND_ISEMPTY) */ { - if (!isset || !i_zend_is_true(*value TSRMLS_CC)) { + if (!isset || !i_zend_is_true(*value)) { ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 1); } else { ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 0); @@ -6017,7 +6017,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CONST_VAR_HANDLER(ZEND_OPC ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 0); } } else /* if (opline->extended_value & ZEND_ISEMPTY) */ { - if (!isset || !i_zend_is_true(*value TSRMLS_CC)) { + if (!isset || !i_zend_is_true(*value)) { ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 1); } else { ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 0); @@ -6722,7 +6722,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CONST_UNUSED_HANDLER(ZEND_ ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 0); } } else /* if (opline->extended_value & ZEND_ISEMPTY) */ { - if (!isset || !i_zend_is_true(*value TSRMLS_CC)) { + if (!isset || !i_zend_is_true(*value)) { ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 1); } else { ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 0); @@ -7722,7 +7722,7 @@ static int ZEND_FASTCALL ZEND_JMPZ_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) if (IS_TMP_VAR == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) { ret = Z_LVAL_P(val); } else { - ret = i_zend_is_true(val TSRMLS_CC); + ret = i_zend_is_true(val); zval_dtor(free_op1.var); if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); @@ -7752,7 +7752,7 @@ static int ZEND_FASTCALL ZEND_JMPNZ_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) if (IS_TMP_VAR == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) { ret = Z_LVAL_P(val); } else { - ret = i_zend_is_true(val TSRMLS_CC); + ret = i_zend_is_true(val); zval_dtor(free_op1.var); if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); @@ -7782,7 +7782,7 @@ static int ZEND_FASTCALL ZEND_JMPZNZ_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) if (IS_TMP_VAR == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) { retval = Z_LVAL_P(val); } else { - retval = i_zend_is_true(val TSRMLS_CC); + retval = i_zend_is_true(val); zval_dtor(free_op1.var); if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); @@ -7816,7 +7816,7 @@ static int ZEND_FASTCALL ZEND_JMPZ_EX_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS if (IS_TMP_VAR == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) { retval = Z_LVAL_P(val); } else { - retval = i_zend_is_true(val TSRMLS_CC); + retval = i_zend_is_true(val); zval_dtor(free_op1.var); if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); @@ -7847,7 +7847,7 @@ static int ZEND_FASTCALL ZEND_JMPNZ_EX_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG if (IS_TMP_VAR == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) { retval = Z_LVAL_P(val); } else { - retval = i_zend_is_true(val TSRMLS_CC); + retval = i_zend_is_true(val); zval_dtor(free_op1.var); if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); @@ -8063,7 +8063,7 @@ static int ZEND_FASTCALL ZEND_BOOL_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) SAVE_OPLINE(); /* PHP 3.0 returned "" for false and 1 for true, here we use 0 and 1 for now */ - ZVAL_BOOL(retval, i_zend_is_true(_get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC) TSRMLS_CC)); + ZVAL_BOOL(retval, i_zend_is_true(_get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC))); zval_dtor(free_op1.var); CHECK_EXCEPTION(); @@ -8550,7 +8550,7 @@ static int ZEND_FASTCALL ZEND_JMP_SET_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS SAVE_OPLINE(); value = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); - if (i_zend_is_true(value TSRMLS_CC)) { + if (i_zend_is_true(value)) { ZVAL_COPY_VALUE(&EX_T(opline->result.var).tmp_var, value); if (!1) { zendi_zval_copy_ctor(EX_T(opline->result.var).tmp_var); @@ -8576,7 +8576,7 @@ static int ZEND_FASTCALL ZEND_JMP_SET_VAR_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ SAVE_OPLINE(); value = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); - if (i_zend_is_true(value TSRMLS_CC)) { + if (i_zend_is_true(value)) { if (IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) { Z_ADDREF_P(value); EX_T(opline->result.var).var.ptr = value; @@ -9535,7 +9535,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_TMP_CONST_HANDLER(ZEND_OPC ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 0); } } else /* if (opline->extended_value & ZEND_ISEMPTY) */ { - if (!isset || !i_zend_is_true(*value TSRMLS_CC)) { + if (!isset || !i_zend_is_true(*value)) { ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 1); } else { ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 0); @@ -11238,7 +11238,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_TMP_VAR_HANDLER(ZEND_OPCOD ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 0); } } else /* if (opline->extended_value & ZEND_ISEMPTY) */ { - if (!isset || !i_zend_is_true(*value TSRMLS_CC)) { + if (!isset || !i_zend_is_true(*value)) { ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 1); } else { ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 0); @@ -11818,7 +11818,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_TMP_UNUSED_HANDLER(ZEND_OP ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 0); } } else /* if (opline->extended_value & ZEND_ISEMPTY) */ { - if (!isset || !i_zend_is_true(*value TSRMLS_CC)) { + if (!isset || !i_zend_is_true(*value)) { ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 1); } else { ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 0); @@ -12920,7 +12920,7 @@ static int ZEND_FASTCALL ZEND_JMPZ_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) if (IS_VAR == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) { ret = Z_LVAL_P(val); } else { - ret = i_zend_is_true(val TSRMLS_CC); + ret = i_zend_is_true(val); zval_ptr_dtor_nogc(&free_op1.var); if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); @@ -12950,7 +12950,7 @@ static int ZEND_FASTCALL ZEND_JMPNZ_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) if (IS_VAR == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) { ret = Z_LVAL_P(val); } else { - ret = i_zend_is_true(val TSRMLS_CC); + ret = i_zend_is_true(val); zval_ptr_dtor_nogc(&free_op1.var); if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); @@ -12980,7 +12980,7 @@ static int ZEND_FASTCALL ZEND_JMPZNZ_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) if (IS_VAR == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) { retval = Z_LVAL_P(val); } else { - retval = i_zend_is_true(val TSRMLS_CC); + retval = i_zend_is_true(val); zval_ptr_dtor_nogc(&free_op1.var); if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); @@ -13014,7 +13014,7 @@ static int ZEND_FASTCALL ZEND_JMPZ_EX_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS if (IS_VAR == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) { retval = Z_LVAL_P(val); } else { - retval = i_zend_is_true(val TSRMLS_CC); + retval = i_zend_is_true(val); zval_ptr_dtor_nogc(&free_op1.var); if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); @@ -13045,7 +13045,7 @@ static int ZEND_FASTCALL ZEND_JMPNZ_EX_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG if (IS_VAR == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) { retval = Z_LVAL_P(val); } else { - retval = i_zend_is_true(val TSRMLS_CC); + retval = i_zend_is_true(val); zval_ptr_dtor_nogc(&free_op1.var); if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); @@ -13366,7 +13366,7 @@ static int ZEND_FASTCALL ZEND_BOOL_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) SAVE_OPLINE(); /* PHP 3.0 returned "" for false and 1 for true, here we use 0 and 1 for now */ - ZVAL_BOOL(retval, i_zend_is_true(_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC) TSRMLS_CC)); + ZVAL_BOOL(retval, i_zend_is_true(_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC))); zval_ptr_dtor_nogc(&free_op1.var); CHECK_EXCEPTION(); @@ -13965,7 +13965,7 @@ static int ZEND_FASTCALL ZEND_JMP_SET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS SAVE_OPLINE(); value = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); - if (i_zend_is_true(value TSRMLS_CC)) { + if (i_zend_is_true(value)) { ZVAL_COPY_VALUE(&EX_T(opline->result.var).tmp_var, value); if (!0) { zendi_zval_copy_ctor(EX_T(opline->result.var).tmp_var); @@ -13991,7 +13991,7 @@ static int ZEND_FASTCALL ZEND_JMP_SET_VAR_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ SAVE_OPLINE(); value = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); - if (i_zend_is_true(value TSRMLS_CC)) { + if (i_zend_is_true(value)) { if (IS_VAR == IS_VAR || IS_VAR == IS_CV) { Z_ADDREF_P(value); EX_T(opline->result.var).var.ptr = value; @@ -16253,7 +16253,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_VAR_CONST_HANDLER(ZEND_OPC ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 0); } } else /* if (opline->extended_value & ZEND_ISEMPTY) */ { - if (!isset || !i_zend_is_true(*value TSRMLS_CC)) { + if (!isset || !i_zend_is_true(*value)) { ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 1); } else { ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 0); @@ -16325,7 +16325,7 @@ num_index_prop: result = isset; } } else /* if (opline->extended_value & ZEND_ISEMPTY) */ { - if (!isset || !i_zend_is_true(*value TSRMLS_CC)) { + if (!isset || !i_zend_is_true(*value)) { result = 0; } else { result = 1; @@ -18395,7 +18395,7 @@ num_index_prop: result = isset; } } else /* if (opline->extended_value & ZEND_ISEMPTY) */ { - if (!isset || !i_zend_is_true(*value TSRMLS_CC)) { + if (!isset || !i_zend_is_true(*value)) { result = 0; } else { result = 1; @@ -20773,7 +20773,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_VAR_VAR_HANDLER(ZEND_OPCOD ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 0); } } else /* if (opline->extended_value & ZEND_ISEMPTY) */ { - if (!isset || !i_zend_is_true(*value TSRMLS_CC)) { + if (!isset || !i_zend_is_true(*value)) { ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 1); } else { ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 0); @@ -20845,7 +20845,7 @@ num_index_prop: result = isset; } } else /* if (opline->extended_value & ZEND_ISEMPTY) */ { - if (!isset || !i_zend_is_true(*value TSRMLS_CC)) { + if (!isset || !i_zend_is_true(*value)) { result = 0; } else { result = 1; @@ -22047,7 +22047,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_VAR_UNUSED_HANDLER(ZEND_OP ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 0); } } else /* if (opline->extended_value & ZEND_ISEMPTY) */ { - if (!isset || !i_zend_is_true(*value TSRMLS_CC)) { + if (!isset || !i_zend_is_true(*value)) { ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 1); } else { ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 0); @@ -24112,7 +24112,7 @@ num_index_prop: result = isset; } } else /* if (opline->extended_value & ZEND_ISEMPTY) */ { - if (!isset || !i_zend_is_true(*value TSRMLS_CC)) { + if (!isset || !i_zend_is_true(*value)) { result = 0; } else { result = 1; @@ -25607,7 +25607,7 @@ num_index_prop: result = isset; } } else /* if (opline->extended_value & ZEND_ISEMPTY) */ { - if (!isset || !i_zend_is_true(*value TSRMLS_CC)) { + if (!isset || !i_zend_is_true(*value)) { result = 0; } else { result = 1; @@ -26916,7 +26916,7 @@ num_index_prop: result = isset; } } else /* if (opline->extended_value & ZEND_ISEMPTY) */ { - if (!isset || !i_zend_is_true(*value TSRMLS_CC)) { + if (!isset || !i_zend_is_true(*value)) { result = 0; } else { result = 1; @@ -28225,7 +28225,7 @@ num_index_prop: result = isset; } } else /* if (opline->extended_value & ZEND_ISEMPTY) */ { - if (!isset || !i_zend_is_true(*value TSRMLS_CC)) { + if (!isset || !i_zend_is_true(*value)) { result = 0; } else { result = 1; @@ -29956,7 +29956,7 @@ num_index_prop: result = isset; } } else /* if (opline->extended_value & ZEND_ISEMPTY) */ { - if (!isset || !i_zend_is_true(*value TSRMLS_CC)) { + if (!isset || !i_zend_is_true(*value)) { result = 0; } else { result = 1; @@ -30440,7 +30440,7 @@ static int ZEND_FASTCALL ZEND_JMPZ_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) if (IS_CV == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) { ret = Z_LVAL_P(val); } else { - ret = i_zend_is_true(val TSRMLS_CC); + ret = i_zend_is_true(val); if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); @@ -30470,7 +30470,7 @@ static int ZEND_FASTCALL ZEND_JMPNZ_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) if (IS_CV == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) { ret = Z_LVAL_P(val); } else { - ret = i_zend_is_true(val TSRMLS_CC); + ret = i_zend_is_true(val); if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); @@ -30500,7 +30500,7 @@ static int ZEND_FASTCALL ZEND_JMPZNZ_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) if (IS_CV == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) { retval = Z_LVAL_P(val); } else { - retval = i_zend_is_true(val TSRMLS_CC); + retval = i_zend_is_true(val); if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); @@ -30534,7 +30534,7 @@ static int ZEND_FASTCALL ZEND_JMPZ_EX_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) if (IS_CV == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) { retval = Z_LVAL_P(val); } else { - retval = i_zend_is_true(val TSRMLS_CC); + retval = i_zend_is_true(val); if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); @@ -30565,7 +30565,7 @@ static int ZEND_FASTCALL ZEND_JMPNZ_EX_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS if (IS_CV == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) { retval = Z_LVAL_P(val); } else { - retval = i_zend_is_true(val TSRMLS_CC); + retval = i_zend_is_true(val); if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); @@ -30870,7 +30870,7 @@ static int ZEND_FASTCALL ZEND_BOOL_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) SAVE_OPLINE(); /* PHP 3.0 returned "" for false and 1 for true, here we use 0 and 1 for now */ - ZVAL_BOOL(retval, i_zend_is_true(_get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC) TSRMLS_CC)); + ZVAL_BOOL(retval, i_zend_is_true(_get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC))); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -31327,7 +31327,7 @@ static int ZEND_FASTCALL ZEND_JMP_SET_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) SAVE_OPLINE(); value = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); - if (i_zend_is_true(value TSRMLS_CC)) { + if (i_zend_is_true(value)) { ZVAL_COPY_VALUE(&EX_T(opline->result.var).tmp_var, value); if (!0) { zendi_zval_copy_ctor(EX_T(opline->result.var).tmp_var); @@ -31352,7 +31352,7 @@ static int ZEND_FASTCALL ZEND_JMP_SET_VAR_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_A SAVE_OPLINE(); value = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); - if (i_zend_is_true(value TSRMLS_CC)) { + if (i_zend_is_true(value)) { if (IS_CV == IS_VAR || IS_CV == IS_CV) { Z_ADDREF_P(value); EX_T(opline->result.var).var.ptr = value; @@ -33380,7 +33380,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CV_CONST_HANDLER(ZEND_OPCO ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 0); } } else /* if (opline->extended_value & ZEND_ISEMPTY) */ { - if (!isset || !i_zend_is_true(*value TSRMLS_CC)) { + if (!isset || !i_zend_is_true(*value)) { ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 1); } else { ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 0); @@ -33452,7 +33452,7 @@ num_index_prop: result = isset; } } else /* if (opline->extended_value & ZEND_ISEMPTY) */ { - if (!isset || !i_zend_is_true(*value TSRMLS_CC)) { + if (!isset || !i_zend_is_true(*value)) { result = 0; } else { result = 1; @@ -35383,7 +35383,7 @@ num_index_prop: result = isset; } } else /* if (opline->extended_value & ZEND_ISEMPTY) */ { - if (!isset || !i_zend_is_true(*value TSRMLS_CC)) { + if (!isset || !i_zend_is_true(*value)) { result = 0; } else { result = 1; @@ -37621,7 +37621,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CV_VAR_HANDLER(ZEND_OPCODE ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 0); } } else /* if (opline->extended_value & ZEND_ISEMPTY) */ { - if (!isset || !i_zend_is_true(*value TSRMLS_CC)) { + if (!isset || !i_zend_is_true(*value)) { ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 1); } else { ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 0); @@ -37693,7 +37693,7 @@ num_index_prop: result = isset; } } else /* if (opline->extended_value & ZEND_ISEMPTY) */ { - if (!isset || !i_zend_is_true(*value TSRMLS_CC)) { + if (!isset || !i_zend_is_true(*value)) { result = 0; } else { result = 1; @@ -38765,7 +38765,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CV_UNUSED_HANDLER(ZEND_OPC ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 0); } } else /* if (opline->extended_value & ZEND_ISEMPTY) */ { - if (!isset || !i_zend_is_true(*value TSRMLS_CC)) { + if (!isset || !i_zend_is_true(*value)) { ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 1); } else { ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 0); @@ -40671,7 +40671,7 @@ num_index_prop: result = isset; } } else /* if (opline->extended_value & ZEND_ISEMPTY) */ { - if (!isset || !i_zend_is_true(*value TSRMLS_CC)) { + if (!isset || !i_zend_is_true(*value)) { result = 0; } else { result = 1; diff --git b/Zend/zend_vm_gen.php a/Zend/zend_vm_gen.php index a25ff9d..fc6c617 100644 --- b/Zend/zend_vm_gen.php +++ a/Zend/zend_vm_gen.php @@ -1216,7 +1216,7 @@ function gen_vm($def, $skel) { fputs($f,"#define $op $code\n"); } - fputs($f, "\n#endif\n"); + fputs($f, "\n#endif"); fclose($f); echo "zend_vm_opcodes.h generated successfully.\n"; diff --git b/Zend/zend_vm_opcodes.h a/Zend/zend_vm_opcodes.h index 0f75196..c4cab07 100644 --- b/Zend/zend_vm_opcodes.h +++ a/Zend/zend_vm_opcodes.h @@ -172,4 +172,4 @@ ZEND_API const char *zend_get_opcode_name(zend_uchar opcode); #define ZEND_RECV_VARIADIC 164 #define ZEND_SEND_UNPACK 165 -#endif +#endif \ No newline at end of file diff --git b/configure.in a/configure.in index 8781cbc..3369b9a 100644 --- b/configure.in +++ a/configure.in @@ -118,7 +118,7 @@ int zend_sprintf(char *buffer, const char *format, ...); ]) PHP_MAJOR_VERSION=5 -PHP_MINOR_VERSION=7 +PHP_MINOR_VERSION=6 PHP_RELEASE_VERSION=0 PHP_EXTRA_VERSION="-dev" PHP_VERSION="$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION.$PHP_RELEASE_VERSION$PHP_EXTRA_VERSION" diff --git b/ext/date/lib/parse_date.re a/ext/date/lib/parse_date.re index af1dcc0..6d91d9a 100644 --- b/ext/date/lib/parse_date.re +++ a/ext/date/lib/parse_date.re @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2014 The PHP Group | + | Copyright (c) 1997-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git b/ext/date/lib/parse_iso_intervals.re a/ext/date/lib/parse_iso_intervals.re index 8c82cfc..cbbf878 100644 --- b/ext/date/lib/parse_iso_intervals.re +++ a/ext/date/lib/parse_iso_intervals.re @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2014 The PHP Group | + | Copyright (c) 1997-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git b/ext/dba/dba_inifile.c a/ext/dba/dba_inifile.c index 6067e99..4d8eae7 100644 --- b/ext/dba/dba_inifile.c +++ a/ext/dba/dba_inifile.c @@ -124,15 +124,14 @@ DBA_EXISTS_FUNC(inifile) DBA_DELETE_FUNC(inifile) { int res; - zend_bool found = 0; INIFILE_DATA; INIFILE_GKEY; - res = inifile_delete_ex(dba, &ini_key, &found TSRMLS_CC); + res = inifile_delete(dba, &ini_key TSRMLS_CC); INIFILE_DONE; - return (res == -1 || !found ? FAILURE : SUCCESS); + return (res == -1 ? FAILURE : SUCCESS); } DBA_FIRSTKEY_FUNC(inifile) diff --git b/ext/dba/libinifile/inifile.c a/ext/dba/libinifile/inifile.c index 218037e..8c771be 100644 --- b/ext/dba/libinifile/inifile.c +++ a/ext/dba/libinifile/inifile.c @@ -402,7 +402,7 @@ static int inifile_copy_to(inifile *dba, size_t pos_start, size_t pos_end, inifi return FAILURE; } php_stream_seek(dba->fp, pos_start, SEEK_SET); - if (SUCCESS != php_stream_copy_to_stream_ex(dba->fp, fp, pos_end - pos_start, NULL)) { + if (!php_stream_copy_to_stream_ex(dba->fp, fp, pos_end - pos_start, NULL)) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not copy group [%zu - %zu] to temporary stream", pos_start, pos_end); return FAILURE; } @@ -413,7 +413,7 @@ static int inifile_copy_to(inifile *dba, size_t pos_start, size_t pos_end, inifi /* {{{ inifile_filter * copy from to dba while ignoring key name (group must equal) */ -static int inifile_filter(inifile *dba, inifile *from, const key_type *key, zend_bool *found TSRMLS_DC) +static int inifile_filter(inifile *dba, inifile *from, const key_type *key TSRMLS_DC) { size_t pos_start = 0, pos_next = 0, pos_curr; int ret = SUCCESS; @@ -424,13 +424,10 @@ static int inifile_filter(inifile *dba, inifile *from, const key_type *key, zend while(inifile_read(from, &ln TSRMLS_CC)) { switch(inifile_key_cmp(&ln.key, key TSRMLS_CC)) { case 0: - if (found) { - *found = (zend_bool) 1; - } pos_curr = php_stream_tell(from->fp); if (pos_start != pos_next) { php_stream_seek(from->fp, pos_start, SEEK_SET); - if (SUCCESS != php_stream_copy_to_stream_ex(from->fp, dba->fp, pos_next - pos_start, NULL)) { + if (!php_stream_copy_to_stream_ex(from->fp, dba->fp, pos_next - pos_start, NULL)) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not copy [%zu - %zu] from temporary stream", pos_next, pos_start); ret = FAILURE; } @@ -449,7 +446,7 @@ static int inifile_filter(inifile *dba, inifile *from, const key_type *key, zend } if (pos_start != pos_next) { php_stream_seek(from->fp, pos_start, SEEK_SET); - if (SUCCESS != php_stream_copy_to_stream_ex(from->fp, dba->fp, pos_next - pos_start, NULL)) { + if (!php_stream_copy_to_stream_ex(from->fp, dba->fp, pos_next - pos_start, NULL)) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not copy [%zu - %zu] from temporary stream", pos_next, pos_start); ret = FAILURE; } @@ -461,7 +458,7 @@ static int inifile_filter(inifile *dba, inifile *from, const key_type *key, zend /* {{{ inifile_delete_replace_append */ -static int inifile_delete_replace_append(inifile *dba, const key_type *key, const val_type *value, int append, zend_bool *found TSRMLS_DC) +static int inifile_delete_replace_append(inifile *dba, const key_type *key, const val_type *value, int append TSRMLS_DC) { size_t pos_grp_start=0, pos_grp_next; inifile *ini_tmp = NULL; @@ -500,7 +497,7 @@ static int inifile_delete_replace_append(inifile *dba, const key_type *key, cons php_stream_seek(dba->fp, 0, SEEK_END); if (pos_grp_next != (size_t)php_stream_tell(dba->fp)) { php_stream_seek(dba->fp, pos_grp_next, SEEK_SET); - if (SUCCESS != php_stream_copy_to_stream_ex(dba->fp, fp_tmp, PHP_STREAM_COPY_ALL, NULL)) { + if (!php_stream_copy_to_stream_ex(dba->fp, fp_tmp, PHP_STREAM_COPY_ALL, NULL)) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not copy remainder to temporary stream"); ret = FAILURE; } @@ -519,7 +516,7 @@ static int inifile_delete_replace_append(inifile *dba, const key_type *key, cons if (key->name && strlen(key->name)) { /* 6 */ if (!append && ini_tmp) { - ret = inifile_filter(dba, ini_tmp, key, found TSRMLS_CC); + ret = inifile_filter(dba, ini_tmp, key TSRMLS_CC); } /* 7 */ @@ -541,7 +538,7 @@ static int inifile_delete_replace_append(inifile *dba, const key_type *key, cons if (fp_tmp && php_stream_tell(fp_tmp)) { php_stream_seek(fp_tmp, 0, SEEK_SET); php_stream_seek(dba->fp, 0, SEEK_END); - if (SUCCESS != php_stream_copy_to_stream_ex(fp_tmp, dba->fp, PHP_STREAM_COPY_ALL, NULL)) { + if (!php_stream_copy_to_stream_ex(fp_tmp, dba->fp, PHP_STREAM_COPY_ALL, NULL)) { php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Could not copy from temporary stream - ini file truncated"); ret = FAILURE; } @@ -566,15 +563,7 @@ static int inifile_delete_replace_append(inifile *dba, const key_type *key, cons */ int inifile_delete(inifile *dba, const key_type *key TSRMLS_DC) { - return inifile_delete_replace_append(dba, key, NULL, 0, NULL TSRMLS_CC); -} -/* }}} */ - -/* {{{ inifile_delete_ex - */ -int inifile_delete_ex(inifile *dba, const key_type *key, zend_bool *found TSRMLS_DC) -{ - return inifile_delete_replace_append(dba, key, NULL, 0, found TSRMLS_CC); + return inifile_delete_replace_append(dba, key, NULL, 0 TSRMLS_CC); } /* }}} */ @@ -582,15 +571,7 @@ int inifile_delete_ex(inifile *dba, const key_type *key, zend_bool *found TSRMLS */ int inifile_replace(inifile *dba, const key_type *key, const val_type *value TSRMLS_DC) { - return inifile_delete_replace_append(dba, key, value, 0, NULL TSRMLS_CC); -} -/* }}} */ - -/* {{{ inifile_replace_ex - */ -int inifile_replace_ex(inifile *dba, const key_type *key, const val_type *value, zend_bool *found TSRMLS_DC) -{ - return inifile_delete_replace_append(dba, key, value, 0, found TSRMLS_CC); + return inifile_delete_replace_append(dba, key, value, 0 TSRMLS_CC); } /* }}} */ @@ -598,7 +579,7 @@ int inifile_replace_ex(inifile *dba, const key_type *key, const val_type *value, */ int inifile_append(inifile *dba, const key_type *key, const val_type *value TSRMLS_DC) { - return inifile_delete_replace_append(dba, key, value, 1, NULL TSRMLS_CC); + return inifile_delete_replace_append(dba, key, value, 1 TSRMLS_CC); } /* }}} */ diff --git b/ext/dba/libinifile/inifile.h a/ext/dba/libinifile/inifile.h index e41dac0..1177610 100644 --- b/ext/dba/libinifile/inifile.h +++ a/ext/dba/libinifile/inifile.h @@ -49,9 +49,7 @@ val_type inifile_fetch(inifile *dba, const key_type *key, int skip TSRMLS_DC); int inifile_firstkey(inifile *dba TSRMLS_DC); int inifile_nextkey(inifile *dba TSRMLS_DC); int inifile_delete(inifile *dba, const key_type *key TSRMLS_DC); -int inifile_delete_ex(inifile *dba, const key_type *key, zend_bool *found TSRMLS_DC); int inifile_replace(inifile *dba, const key_type *key, const val_type *val TSRMLS_DC); -int inifile_replace_ex(inifile *dba, const key_type *key, const val_type *val, zend_bool *found TSRMLS_DC); int inifile_append(inifile *dba, const key_type *key, const val_type *val TSRMLS_DC); char *inifile_version(); diff --git b/ext/dba/tests/bug62490.phpt a/ext/dba/tests/bug62490.phpt deleted file mode 100644 index 325dd34..0000000 --- b/ext/dba/tests/bug62490.phpt +++ /dev/null @@ -1,43 +0,0 @@ ---TEST-- -Bug #62490 (dba_delete returns true on missing item (inifile)) ---SKIPIF-- -<?php -$handler = "inifile"; -include "skipif.inc"; -?> ---FILE-- -<?php -$handler = "inifile"; -include "test.inc"; - -$dba = dba_open($db_filename, "n", $handler) - or die; -for ($i = 0; $i < 3; ++$i) { - echo "insert $i:"; - var_dump(dba_insert("a", $i, $dba)); -} - -echo "exists:"; -var_dump(dba_exists("a", $dba)); -echo "delete:"; -var_dump(dba_delete("a", $dba)); -echo "exists:"; -var_dump(dba_exists("a", $dba)); -echo "delete:"; -var_dump(dba_delete("a", $dba)); - -?> -===DONE=== ---CLEAN-- -<?php -include "clean.inc"; -?> ---EXPECT-- -insert 0:bool(true) -insert 1:bool(true) -insert 2:bool(true) -exists:bool(true) -delete:bool(true) -exists:bool(false) -delete:bool(false) -===DONE=== diff --git b/ext/dba/tests/dba_db4_003.phpt a/ext/dba/tests/dba_db4_003.phpt index 8708170..7e8568c 100644 --- b/ext/dba/tests/dba_db4_003.phpt +++ a/ext/dba/tests/dba_db4_003.phpt @@ -39,6 +39,8 @@ require(dirname(__FILE__) .'/clean.inc'); database handler: db4 int(14) +Notice: dba_open(): %stest0.dbm: unexpected file type or format in %sdba_db4_003.php on line %d + Warning: dba_open(%stest0.dbm,c): Driver initialization failed for handler: db4: Invalid argument in %sdba_db4_003.php on line %d Error creating %stest0.dbm Dummy contents diff --git b/ext/dba/tests/dba_db4_007.phpt a/ext/dba/tests/dba_db4_007.phpt index 027d0af..bd95e0b 100644 --- b/ext/dba/tests/dba_db4_007.phpt +++ a/ext/dba/tests/dba_db4_007.phpt @@ -35,5 +35,7 @@ require(dirname(__FILE__) .'/clean.inc'); database handler: db4 int(14) +Notice: dba_popen(): %stest0.dbm: unexpected file type or format in %sdba_db4_007.php on line %d + Warning: dba_popen(%stest0.dbm,c): Driver initialization failed for handler: db4: Invalid argument in %sdba_db4_007.php on line %d Error creating %stest0.dbm diff --git b/ext/dba/tests/dba_db4_010.phpt a/ext/dba/tests/dba_db4_010.phpt new file mode 100644 index 0000000..fb31f05 --- /dev/null +++ a/ext/dba/tests/dba_db4_010.phpt @@ -0,0 +1,38 @@ +--TEST-- +DBA DB4 magic_quotes_runtime Test +--SKIPIF-- +<?php +$handler = "db4"; +require_once(dirname(__FILE__) .'/skipif.inc'); +die("info $HND handler used"); +?> +--FILE-- +<?php +$handler = "db4"; +require_once(dirname(__FILE__) .'/test.inc'); +echo "database handler: $handler\n"; +if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) { + ini_set('magic_quotes_runtime', 0); + dba_insert("key1", '"', $db_file); + var_dump(dba_fetch("key1", $db_file)); + ini_set('magic_quotes_runtime', 1); + var_dump(dba_fetch("key1", $db_file)); + dba_replace("key1", '\"', $db_file); + var_dump(dba_fetch("key1", $db_file)); + ini_set('magic_quotes_runtime', 0); + var_dump(dba_fetch("key1", $db_file)); + dba_close($db_file); +} else { + echo "Error creating database\n"; +} +?> +--CLEAN-- +<?php +require(dirname(__FILE__) .'/clean.inc'); +?> +--EXPECTF-- +database handler: db4 +string(1) """ +string(2) "\"" +string(2) "\"" +string(1) """ diff --git b/ext/dba/tests/dba_handler.inc a/ext/dba/tests/dba_handler.inc index ed2a524..a950e90 100644 --- b/ext/dba/tests/dba_handler.inc +++ a/ext/dba/tests/dba_handler.inc @@ -82,7 +82,7 @@ do { dba_close($dba_reader); } if (($db_file = dba_popen($db_filename, 'r'.($lock_flag==''?'':'-'), $handler))!==FALSE) { - if ($handler == 'dbm' || $handler == "tcadb") { + if ($handler == 'dbm') { dba_close($db_file); } } diff --git b/ext/dba/tests/dba_inifile.phpt a/ext/dba/tests/dba_inifile.phpt index ae06aee..5975d25 100644 --- b/ext/dba/tests/dba_inifile.phpt +++ a/ext/dba/tests/dba_inifile.phpt @@ -12,10 +12,6 @@ DBA INIFILE handler test require_once dirname(__FILE__) .'/dba_handler.inc'; ?> ===DONE=== ---CLEAN-- -<?php - require(dirname(__FILE__) .'/clean.inc'); -?> --EXPECT-- database handler: inifile 3NYNYY @@ -23,7 +19,7 @@ Content String 2 Content 2 replaced Read during write: not allowed "key number 6" written -"key number 6" written 2nd time +Failed to write "key number 6" 2nd time Content 2 replaced 2nd time The 6th value array(3) { @@ -40,7 +36,7 @@ Content String 2 Content 2 replaced Read during write: not allowed "key number 6" written -"key number 6" written 2nd time +Failed to write "key number 6" 2nd time Content 2 replaced 2nd time The 6th value array(3) { diff --git b/ext/dba/tests/dba_tcadb.phpt a/ext/dba/tests/dba_tcadb.phpt index f75aa81..28b6dd8 100644 --- b/ext/dba/tests/dba_tcadb.phpt +++ a/ext/dba/tests/dba_tcadb.phpt @@ -16,12 +16,6 @@ DBA TCADB handler test require_once dirname(__FILE__) .'/dba_handler.inc'; ?> ===DONE=== ---CLEAN-- -<?php -$db_filename = $db_file = dirname(__FILE__) .'/test0.tch'; -@unlink($db_filename); -@unlink($db_filename.'.lck'); -?> --EXPECT-- database handler: tcadb 3NYNYY diff --git b/ext/dom/php_dom.c a/ext/dom/php_dom.c index bfe966b..0623dbd 100644 --- b/ext/dom/php_dom.c +++ a/ext/dom/php_dom.c @@ -448,7 +448,7 @@ static int dom_property_exists(zval *object, zval *member, int check_empty, cons Z_SET_REFCOUNT_P(tmp, 1); Z_UNSET_ISREF_P(tmp); if (check_empty == 1) { - retval = zend_is_true(tmp TSRMLS_CC); + retval = zend_is_true(tmp); } else if (check_empty == 0) { retval = (Z_TYPE_P(tmp) != IS_NULL); } diff --git b/ext/gd/libgd/gdft.c a/ext/gd/libgd/gdft.c index aa8e8d3..ac2bf34 100644 --- b/ext/gd/libgd/gdft.c +++ a/ext/gd/libgd/gdft.c @@ -1050,15 +1050,7 @@ gdImageStringFTEx (gdImage * im, int *brect, int fg, char *fontlist, double ptsi } /* transform glyph image */ - if (FT_Get_Glyph(slot, &image)) { - if (tmpstr) { - gdFree(tmpstr); - } - gdCacheDelete(tc_cache); - gdMutexUnlock(gdFontCacheMutex); - return "Problem loading glyph"; - } - + FT_Get_Glyph(slot, &image); if (brect) { /* only if need brect */ FT_Glyph_Get_CBox(image, ft_glyph_bbox_gridfit, &glyph_bbox); glyph_bbox.xMin += penf.x; diff --git b/ext/json/json.c a/ext/json/json.c index d939a7d..f38cc11 100644 --- b/ext/json/json.c +++ a/ext/json/json.c @@ -190,10 +190,10 @@ static int json_determine_array_type(zval **val TSRMLS_DC) /* {{{ */ } if (i == HASH_KEY_IS_STRING) { - return PHP_JSON_OUTPUT_OBJECT; + return 1; } else { if (index != idx) { - return PHP_JSON_OUTPUT_OBJECT; + return 1; } } idx++; diff --git b/ext/libxml/tests/libxml_disable_entity_loader.phpt a/ext/libxml/tests/libxml_disable_entity_loader.phpt deleted file mode 100644 index 6477543..0000000 --- b/ext/libxml/tests/libxml_disable_entity_loader.phpt +++ /dev/null @@ -1,41 +0,0 @@ ---TEST-- -libxml_disable_entity_loader() ---SKIPIF-- -<?php if (!extension_loaded('libxml') || !extension_loaded('dom') || defined('PHP_WINDOWS_VERSION_MAJOR')) die('skip'); ?> ---FILE-- -<?php - -$xml = <<<EOT -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE test [<!ENTITY xxe SYSTEM "XXE_URI">]> -<foo>&xxe;</foo> -EOT; - -$xml = str_replace('XXE_URI', __DIR__ . '/libxml_disable_entity_loader_payload.txt', $xml); - -function parseXML($xml) { - $doc = new DOMDocument(); - $doc->resolveExternals = true; - $doc->substituteEntities = true; - $doc->validateOnParse = false; - $doc->loadXML($xml, 0); - return $doc->saveXML(); -} - -var_dump(strpos(parseXML($xml), 'SECRET_DATA') !== false); -var_dump(libxml_disable_entity_loader(true)); -var_dump(strpos(parseXML($xml), 'SECRET_DATA') === false); - -echo "Done\n"; -?> ---EXPECTF-- -bool(true) -bool(false) - -Warning: DOMDocument::loadXML(): I/O warning : failed to load external entity "%s" in %s on line %d - -Warning: DOMDocument::loadXML(): Failure to process entity xxe in Entity, line: %d in %s on line %d - -Warning: DOMDocument::loadXML(): Entity 'xxe' not defined in Entity, line: %d in %s on line %d -bool(true) -Done diff --git b/ext/libxml/tests/libxml_disable_entity_loader_payload.txt a/ext/libxml/tests/libxml_disable_entity_loader_payload.txt deleted file mode 100644 index 3b8a43c..0000000 --- b/ext/libxml/tests/libxml_disable_entity_loader_payload.txt +++ /dev/null @@ -1 +0,0 @@ -SECRET_DATA \ No newline at end of file diff --git b/ext/mysqlnd/mysqlnd_net.c a/ext/mysqlnd/mysqlnd_net.c index 226c855..fadcbd8 100644 --- b/ext/mysqlnd/mysqlnd_net.c +++ a/ext/mysqlnd/mysqlnd_net.c @@ -900,11 +900,7 @@ MYSQLND_METHOD(mysqlnd_net, enable_ssl)(MYSQLND_NET * const net TSRMLS_DC) ZVAL_STRING(&cipher_zval, net->data->options.ssl_cipher, 0); php_stream_context_set_option(context, "ssl", "ciphers", &cipher_zval); } -#if PHP_API_VERSION >= 20131106 - php_stream_context_set(net_stream, context TSRMLS_CC); -#else php_stream_context_set(net_stream, context); -#endif if (php_stream_xport_crypto_setup(net_stream, STREAM_CRYPTO_METHOD_TLS_CLIENT, NULL TSRMLS_CC) < 0 || php_stream_xport_crypto_enable(net_stream, 1 TSRMLS_CC) < 0) { @@ -920,11 +916,7 @@ MYSQLND_METHOD(mysqlnd_net, enable_ssl)(MYSQLND_NET * const net TSRMLS_DC) of the context, which means usage of already freed memory, bad. Actually we don't need this context anymore after we have enabled SSL on the connection. Thus it is very simple, we remove it. */ -#if PHP_API_VERSION >= 20131106 - php_stream_context_set(net_stream, NULL TSRMLS_CC); -#else php_stream_context_set(net_stream, NULL); -#endif if (net->data->options.timeout_read) { struct timeval tv; diff --git b/ext/mysqlnd/mysqlnd_ps_codec.c a/ext/mysqlnd/mysqlnd_ps_codec.c index 1af4912..d0e44fa 100644 --- b/ext/mysqlnd/mysqlnd_ps_codec.c +++ a/ext/mysqlnd/mysqlnd_ps_codec.c @@ -516,69 +516,68 @@ mysqlnd_stmt_copy_it(zval *** copies, zval * original, unsigned int param_count, /* }}} */ -/* {{{ mysqlnd_stmt_free_copies */ -static void -mysqlnd_stmt_free_copies(MYSQLND_STMT_DATA * stmt, zval ** copies TSRMLS_DC) -{ - if (copies) { - unsigned int i; - for (i = 0; i < stmt->param_count; i++) { - if (copies[i]) { - zval_ptr_dtor(&copies[i]); - } - } - mnd_efree(copies); - } -} -/* }}} */ - - -/* {{{ mysqlnd_stmt_execute_check_n_enlarge_buffer */ +/* {{{ mysqlnd_stmt_execute_store_params */ static enum_func_status -mysqlnd_stmt_execute_check_n_enlarge_buffer(zend_uchar **buf, zend_uchar **p, size_t * buf_len, zend_uchar * const provided_buffer, size_t needed_bytes TSRMLS_DC) +mysqlnd_stmt_execute_store_params(MYSQLND_STMT * s, zend_uchar **buf, zend_uchar **p, size_t *buf_len TSRMLS_DC) { - const size_t overalloc = 5; + MYSQLND_STMT_DATA * stmt = s->data; + unsigned int i = 0; + zend_uchar * provided_buffer = *buf; size_t left = (*buf_len - (*p - *buf)); + size_t data_size = 0; + zval **copies = NULL;/* if there are different types */ + enum_func_status ret = FAIL; + int resend_types_next_time = 0; + size_t null_byte_offset; - if (left < (needed_bytes + overalloc)) { - size_t offset = *p - *buf; - zend_uchar *tmp_buf; - *buf_len = offset + needed_bytes + overalloc; - tmp_buf = mnd_emalloc(*buf_len); - if (!tmp_buf) { - return FAIL; - } - memcpy(tmp_buf, *buf, offset); - if (*buf != provided_buffer) { - mnd_efree(*buf); + DBG_ENTER("mysqlnd_stmt_execute_store_params"); + + { + unsigned int null_count = (stmt->param_count + 7) / 8; + /* give it some reserved space - 20 bytes */ + if (left < (null_count + 20)) { + unsigned int offset = *p - *buf; + zend_uchar *tmp_buf; + *buf_len = offset + null_count + 20; + tmp_buf = mnd_emalloc(*buf_len); + if (!tmp_buf) { + SET_OOM_ERROR(*stmt->error_info); + goto end; + } + memcpy(tmp_buf, *buf, offset); + if (*buf != provided_buffer) { + mnd_efree(*buf); + } + *buf = tmp_buf; + + /* Update our pos pointer */ + *p = *buf + offset; } - *buf = tmp_buf; - /* Update our pos pointer */ - *p = *buf + offset; + /* put `null` bytes */ + null_byte_offset = *p - *buf; + memset(*p, 0, null_count); + *p += null_count; } - return PASS; -} -/* }}} */ - -/* {{{ mysqlnd_stmt_execute_prepare_param_types */ -static enum_func_status -mysqlnd_stmt_execute_prepare_param_types(MYSQLND_STMT_DATA * stmt, zval *** copies_param, int * resend_types_next_time TSRMLS_DC) -{ - unsigned int i; - DBG_ENTER("mysqlnd_stmt_execute_prepare_param_types"); + left = (*buf_len - (*p - *buf)); +/* 1. Store type information */ + /* + check if need to send the types even if stmt->send_types_to_server is 0. This is because + if we send "i" (42) then the type will be int and the server will expect int. However, if next + time we try to send > LONG_MAX, the conversion to string will send a string and the server + won't expect it and interpret the value as 0. Thus we need to resend the types, if any such values + occur, and force resend for the next execution. + */ for (i = 0; i < stmt->param_count; i++) { short current_type = stmt->param_bind[i].type; if (Z_TYPE_P(stmt->param_bind[i].zv) != IS_NULL && (current_type == MYSQL_TYPE_LONG || current_type == MYSQL_TYPE_LONGLONG)) { - zval ** copies; /* always copy the var, because we do many conversions */ if (Z_TYPE_P(stmt->param_bind[i].zv) != IS_LONG && - PASS != mysqlnd_stmt_copy_it(copies_param, stmt->param_bind[i].zv, stmt->param_count, i TSRMLS_CC)) + PASS != mysqlnd_stmt_copy_it(&copies, stmt->param_bind[i].zv, stmt->param_count, i TSRMLS_CC)) { SET_OOM_ERROR(*stmt->error_info); goto end; } - copies = *copies_param; /* if it doesn't fit in a long send it as a string. Check bug #52891 : Wrong data inserted with mysqli/mysqlnd when using bind_param, value > LONG_MAX @@ -603,7 +602,7 @@ mysqlnd_stmt_execute_prepare_param_types(MYSQLND_STMT_DATA * stmt, zval *** copi We do transformation here, which will be used later when sending types. The code later relies on this. */ if (Z_DVAL_P(tmp_data_copy) > LONG_MAX || Z_DVAL_P(tmp_data_copy) < LONG_MIN) { - stmt->send_types_to_server = *resend_types_next_time = 1; + stmt->send_types_to_server = resend_types_next_time = 1; convert_to_string_ex(&tmp_data); } else { convert_to_long_ex(&tmp_data); @@ -613,64 +612,69 @@ mysqlnd_stmt_execute_prepare_param_types(MYSQLND_STMT_DATA * stmt, zval *** copi } } } - DBG_RETURN(PASS); -end: - DBG_RETURN(FAIL); -} -/* }}} */ + int1store(*p, stmt->send_types_to_server); + (*p)++; -/* {{{ mysqlnd_stmt_execute_store_types */ -static void -mysqlnd_stmt_execute_store_types(MYSQLND_STMT_DATA * stmt, zval ** copies, zend_uchar ** p) -{ - unsigned int i; - for (i = 0; i < stmt->param_count; i++) { - short current_type = stmt->param_bind[i].type; - /* our types are not unsigned */ -#if SIZEOF_LONG==8 - if (current_type == MYSQL_TYPE_LONG) { - current_type = MYSQL_TYPE_LONGLONG; + if (stmt->send_types_to_server) { + /* 2 bytes per type, and leave 20 bytes for future use */ + if (left < ((stmt->param_count * 2) + 20)) { + unsigned int offset = *p - *buf; + zend_uchar *tmp_buf; + *buf_len = offset + stmt->param_count * 2 + 20; + tmp_buf = mnd_emalloc(*buf_len); + if (!tmp_buf) { + SET_OOM_ERROR(*stmt->error_info); + goto end; + } + memcpy(tmp_buf, *buf, offset); + if (*buf != provided_buffer) { + mnd_efree(*buf); + } + *buf = tmp_buf; + + /* Update our pos pointer */ + *p = *buf + offset; } + for (i = 0; i < stmt->param_count; i++) { + short current_type = stmt->param_bind[i].type; + /* our types are not unsigned */ +#if SIZEOF_LONG==8 + if (current_type == MYSQL_TYPE_LONG) { + current_type = MYSQL_TYPE_LONGLONG; + } #endif - if (Z_TYPE_P(stmt->param_bind[i].zv) != IS_NULL && (current_type == MYSQL_TYPE_LONG || current_type == MYSQL_TYPE_LONGLONG)) { - /* - if it doesn't fit in a long send it as a string. - Check bug #52891 : Wrong data inserted with mysqli/mysqlnd when using bind_param, value > LONG_MAX - */ - if (Z_TYPE_P(stmt->param_bind[i].zv) != IS_LONG) { - const zval *tmp_data = (copies && copies[i])? copies[i]: stmt->param_bind[i].zv; + if (Z_TYPE_P(stmt->param_bind[i].zv) != IS_NULL && (current_type == MYSQL_TYPE_LONG || current_type == MYSQL_TYPE_LONGLONG)) { /* - In case of IS_LONG we do nothing, it is ok, in case of string, we just need to set current_type. - The actual transformation has been performed several dozens line above. + if it doesn't fit in a long send it as a string. + Check bug #52891 : Wrong data inserted with mysqli/mysqlnd when using bind_param, value > LONG_MAX */ - if (Z_TYPE_P(tmp_data) == IS_STRING) { - current_type = MYSQL_TYPE_VAR_STRING; + if (Z_TYPE_P(stmt->param_bind[i].zv) != IS_LONG) { + zval *tmp_data = (copies && copies[i])? copies[i]: stmt->param_bind[i].zv; /* - don't change stmt->param_bind[i].type to MYSQL_TYPE_VAR_STRING - we force convert_to_long_ex in all cases, thus the type will be right in the next switch. - if the type is however not long, then we will do a goto in the next switch. - We want to preserve the original bind type given by the user. Thus, we do these hacks. + In case of IS_LONG we do nothing, it is ok, in case of string, we just need to set current_type. + The actual transformation has been performed several dozens line above. */ + if (Z_TYPE_P(tmp_data) == IS_STRING) { + current_type = MYSQL_TYPE_VAR_STRING; + /* + don't change stmt->param_bind[i].type to MYSQL_TYPE_VAR_STRING + we force convert_to_long_ex in all cases, thus the type will be right in the next switch. + if the type is however not long, then we will do a goto in the next switch. + We want to preserve the original bind type given by the user. Thus, we do these hacks. + */ + } } } + int2store(*p, current_type); + *p+= 2; } - int2store(*p, current_type); - *p+= 2; } -} -/* }}} */ - - -/* {{{ mysqlnd_stmt_execute_calculate_param_values_size */ -static enum_func_status -mysqlnd_stmt_execute_calculate_param_values_size(MYSQLND_STMT_DATA * stmt, zval *** copies_param, size_t * data_size TSRMLS_DC) -{ - unsigned int i; - DBG_ENTER("mysqlnd_stmt_execute_calculate_param_values_size"); + stmt->send_types_to_server = resend_types_next_time; +/* 2. Store data */ + /* 2.1 Calculate how much space we need */ for (i = 0; i < stmt->param_count; i++) { - zval ** copies = NULL; unsigned int j; zval *the_var = stmt->param_bind[i].zv; @@ -681,7 +685,7 @@ mysqlnd_stmt_execute_calculate_param_values_size(MYSQLND_STMT_DATA * stmt, zval if (stmt->param_bind[j].zv == the_var) { /* Double binding of the same zval, make a copy */ if (!copies || !copies[i]) { - if (PASS != mysqlnd_stmt_copy_it(copies_param, the_var, stmt->param_count, i TSRMLS_CC)) { + if (PASS != mysqlnd_stmt_copy_it(&copies, the_var, stmt->param_count, i TSRMLS_CC)) { SET_OOM_ERROR(*stmt->error_info); goto end; } @@ -690,14 +694,12 @@ mysqlnd_stmt_execute_calculate_param_values_size(MYSQLND_STMT_DATA * stmt, zval } } - copies = *copies_param; - switch (stmt->param_bind[i].type) { case MYSQL_TYPE_DOUBLE: - *data_size += 8; + data_size += 8; if (Z_TYPE_P(the_var) != IS_DOUBLE) { if (!copies || !copies[i]) { - if (PASS != mysqlnd_stmt_copy_it(copies_param, the_var, stmt->param_count, i TSRMLS_CC)) { + if (PASS != mysqlnd_stmt_copy_it(&copies, the_var, stmt->param_count, i TSRMLS_CC)) { SET_OOM_ERROR(*stmt->error_info); goto end; } @@ -712,7 +714,7 @@ mysqlnd_stmt_execute_calculate_param_values_size(MYSQLND_STMT_DATA * stmt, zval } convert_to_long_ex(&tmp_data); } - *data_size += 8; + data_size += 8; break; case MYSQL_TYPE_LONG: { @@ -722,7 +724,7 @@ mysqlnd_stmt_execute_calculate_param_values_size(MYSQLND_STMT_DATA * stmt, zval } convert_to_long_ex(&tmp_data); } - *data_size += 4; + data_size += 4; break; case MYSQL_TYPE_LONG_BLOB: if (!(stmt->param_bind[i].flags & MYSQLND_PARAM_BIND_BLOB_USED)) { @@ -731,41 +733,55 @@ mysqlnd_stmt_execute_calculate_param_values_size(MYSQLND_STMT_DATA * stmt, zval Empty string has length of 0, encoded in 1 byte. No real data will follows after it. */ - (*data_size)++; + data_size++; } break; case MYSQL_TYPE_VAR_STRING: use_string: - *data_size += 8; /* max 8 bytes for size */ + data_size += 8; /* max 8 bytes for size */ if (Z_TYPE_P(the_var) != IS_STRING) { if (!copies || !copies[i]) { - if (PASS != mysqlnd_stmt_copy_it(copies_param, the_var, stmt->param_count, i TSRMLS_CC)) { + if (PASS != mysqlnd_stmt_copy_it(&copies, the_var, stmt->param_count, i TSRMLS_CC)) { SET_OOM_ERROR(*stmt->error_info); goto end; } } - copies = *copies_param; the_var = copies[i]; } convert_to_string_ex(&the_var); - *data_size += Z_STRLEN_P(the_var); + data_size += Z_STRLEN_P(the_var); break; } } - DBG_RETURN(PASS); -end: - DBG_RETURN(FAIL); -} -/* }}} */ + /* 2.2 Enlarge the buffer, if needed */ + left = (*buf_len - (*p - *buf)); + if (left < data_size) { + unsigned int offset = *p - *buf; + zend_uchar *tmp_buf; + *buf_len = offset + data_size + 10; /* Allocate + 10 for safety */ + tmp_buf = mnd_emalloc(*buf_len); + if (!tmp_buf) { + SET_OOM_ERROR(*stmt->error_info); + goto end; + } + memcpy(tmp_buf, *buf, offset); + /* + When too many columns the buffer provided to the function might not be sufficient. + In this case new buffer has been allocated above. When we allocate a buffer and then + allocate a bigger one here, we should free the first one. + */ + if (*buf != provided_buffer) { + mnd_efree(*buf); + } + *buf = tmp_buf; + /* Update our pos pointer */ + *p = *buf + offset; + } -/* {{{ mysqlnd_stmt_execute_store_param_values */ -static void -mysqlnd_stmt_execute_store_param_values(MYSQLND_STMT_DATA * stmt, zval ** copies, zend_uchar ** buf, zend_uchar ** p, size_t null_byte_offset) -{ - unsigned int i; + /* 2.3 Store the actual data */ for (i = 0; i < stmt->param_count; i++) { - zval * data = (copies && copies[i])? copies[i]: stmt->param_bind[i].zv; + zval *data = (copies && copies[i])? copies[i]: stmt->param_bind[i].zv; /* Handle long data */ if (stmt->param_bind[i].zv && Z_TYPE_P(data) == IS_NULL) { (*buf + null_byte_offset)[i/8] |= (zend_uchar) (1 << (i & 7)); @@ -817,78 +833,16 @@ send_string: } } } -} -/* }}} */ - - -/* {{{ mysqlnd_stmt_execute_store_params */ -static enum_func_status -mysqlnd_stmt_execute_store_params(MYSQLND_STMT * s, zend_uchar ** buf, zend_uchar ** p, size_t * buf_len TSRMLS_DC) -{ - MYSQLND_STMT_DATA * stmt = s->data; - zend_uchar * provided_buffer = *buf; - size_t data_size = 0; - zval ** copies = NULL;/* if there are different types */ - enum_func_status ret = FAIL; - int resend_types_next_time = 0; - size_t null_byte_offset; - - DBG_ENTER("mysqlnd_stmt_execute_store_params"); - - { - unsigned int null_count = (stmt->param_count + 7) / 8; - if (FAIL == mysqlnd_stmt_execute_check_n_enlarge_buffer(buf, p, buf_len, provided_buffer, null_count TSRMLS_CC)) { - SET_OOM_ERROR(*stmt->error_info); - goto end; - } - /* put `null` bytes */ - null_byte_offset = *p - *buf; - memset(*p, 0, null_count); - *p += null_count; - } - -/* 1. Store type information */ - /* - check if need to send the types even if stmt->send_types_to_server is 0. This is because - if we send "i" (42) then the type will be int and the server will expect int. However, if next - time we try to send > LONG_MAX, the conversion to string will send a string and the server - won't expect it and interpret the value as 0. Thus we need to resend the types, if any such values - occur, and force resend for the next execution. - */ - if (FAIL == mysqlnd_stmt_execute_prepare_param_types(stmt, &copies, &resend_types_next_time TSRMLS_CC)) { - goto end; - } - - int1store(*p, stmt->send_types_to_server); - (*p)++; - - if (stmt->send_types_to_server) { - if (FAIL == mysqlnd_stmt_execute_check_n_enlarge_buffer(buf, p, buf_len, provided_buffer, stmt->param_count * 2 TSRMLS_CC)) { - SET_OOM_ERROR(*stmt->error_info); - goto end; - } - mysqlnd_stmt_execute_store_types(stmt, copies, p); - } - stmt->send_types_to_server = resend_types_next_time; - -/* 2. Store actual data */ - /* 2.1 Calculate how much space we need */ - if (FAIL == mysqlnd_stmt_execute_calculate_param_values_size(stmt, &copies, &data_size TSRMLS_CC)) { - goto end; - } - - /* 2.2 Enlarge the buffer, if needed */ - if (FAIL == mysqlnd_stmt_execute_check_n_enlarge_buffer(buf, p, buf_len, provided_buffer, data_size TSRMLS_CC)) { - SET_OOM_ERROR(*stmt->error_info); - goto end; - } - - /* 2.3 Store the actual data */ - mysqlnd_stmt_execute_store_param_values(stmt, copies, buf, p, null_byte_offset); - ret = PASS; end: - mysqlnd_stmt_free_copies(stmt, copies TSRMLS_CC); + if (copies) { + for (i = 0; i < stmt->param_count; i++) { + if (copies[i]) { + zval_ptr_dtor(&copies[i]); + } + } + mnd_efree(copies); + } DBG_INF_FMT("ret=%s", ret == PASS? "PASS":"FAIL"); DBG_RETURN(ret); @@ -898,7 +852,7 @@ end: /* {{{ mysqlnd_stmt_execute_generate_request */ enum_func_status -mysqlnd_stmt_execute_generate_request(MYSQLND_STMT * const s, zend_uchar ** request, size_t * request_len, zend_bool * free_buffer TSRMLS_DC) +mysqlnd_stmt_execute_generate_request(MYSQLND_STMT * const s, zend_uchar ** request, size_t *request_len, zend_bool * free_buffer TSRMLS_DC) { MYSQLND_STMT_DATA * stmt = s->data; zend_uchar *p = stmt->execute_cmd_buffer.buffer, @@ -931,51 +885,6 @@ mysqlnd_stmt_execute_generate_request(MYSQLND_STMT * const s, zend_uchar ** requ } /* }}} */ - -/* {{{ mysqlnd_stmt_execute_batch_generate_request */ -enum_func_status -mysqlnd_stmt_execute_batch_generate_request(MYSQLND_STMT * const s, zend_uchar ** request, size_t *request_len, zend_bool * free_buffer TSRMLS_DC) -{ - MYSQLND_STMT_DATA * stmt = s->data; - zend_uchar *p = stmt->execute_cmd_buffer.buffer; - enum_func_status ret; - - DBG_ENTER("mysqlnd_stmt_execute_batch_generate_request"); - - int4store(p, stmt->stmt_id); - p += 4; - - /* flags is 4 bytes, we store just 1 */ - int1store(p, (zend_uchar) stmt->flags); - p++; - - int2store(p, stmt->param_count); - p+= 2; - - int2store(p, 0); /* reserved */ - p+= 2; - - { - zend_uchar * provided_buffer = stmt->execute_cmd_buffer.buffer; - size_t provided_buffer_length = stmt->execute_cmd_buffer.length; - uint i= 0; - for (;i < 5; i++) { - ret = mysqlnd_stmt_execute_store_params(s, &provided_buffer, &p, &provided_buffer_length TSRMLS_CC); - if (ret == FAIL) { - break; - } - - *free_buffer = (provided_buffer != stmt->execute_cmd_buffer.buffer); - *request_len = (p - provided_buffer); - *request = provided_buffer; - } - } - DBG_INF_FMT("ret=%s", ret == PASS? "PASS":"FAIL"); - DBG_RETURN(ret); -} -/* }}} */ - - /* * Local variables: * tab-width: 4 diff --git b/ext/opcache/Optimizer/block_pass.c a/ext/opcache/Optimizer/block_pass.c index a611473..fff5d7e 100644 --- b/ext/opcache/Optimizer/block_pass.c +++ a/ext/opcache/Optimizer/block_pass.c @@ -1466,12 +1466,7 @@ static void zend_jmp_optimization(zend_code_block *block, zend_op_array *op_arra case ZEND_JMPNZ: /* constant conditional JMPs */ if (ZEND_OP1_TYPE(last_op) == IS_CONST) { -#if ZEND_EXTENSION_API_NO > PHP_5_6_X_API_NO - int should_jmp = zend_is_true(&ZEND_OP1_LITERAL(last_op) TSRMLS_CC); -#else int should_jmp = zend_is_true(&ZEND_OP1_LITERAL(last_op)); -#endif - if (last_op->opcode == ZEND_JMPZ) { should_jmp = !should_jmp; } @@ -1614,12 +1609,7 @@ next_target: case ZEND_JMPZ_EX: /* constant conditional JMPs */ if (ZEND_OP1_TYPE(last_op) == IS_CONST) { -#if ZEND_EXTENSION_API_NO > PHP_5_6_X_API_NO - int should_jmp = zend_is_true(&ZEND_OP1_LITERAL(last_op) TSRMLS_CC); -#else int should_jmp = zend_is_true(&ZEND_OP1_LITERAL(last_op)); -#endif - if (last_op->opcode == ZEND_JMPZ_EX) { should_jmp = !should_jmp; } @@ -1740,11 +1730,7 @@ next_target_ex: } if (ZEND_OP1_TYPE(last_op) == IS_CONST) { -#if ZEND_EXTENSION_API_NO > PHP_5_6_X_API_NO - if (!zend_is_true(&ZEND_OP1_LITERAL(last_op) TSRMLS_CC)) { -#else if (!zend_is_true(&ZEND_OP1_LITERAL(last_op))) { -#endif /* JMPZNZ(false,L1,L2) -> JMP(L1) */ zend_code_block *todel; diff --git b/ext/opcache/Optimizer/pass2.c a/ext/opcache/Optimizer/pass2.c index d5f4f04..30708a0 100644 --- b/ext/opcache/Optimizer/pass2.c +++ a/ext/opcache/Optimizer/pass2.c @@ -89,11 +89,7 @@ if (ZEND_OPTIMIZER_PASS_2 & OPTIMIZATION_LEVEL) { /* convert Ti = JMPZ_EX(C, L) => Ti = QM_ASSIGN(C) in case we know it wouldn't jump */ } else if (ZEND_OP1_TYPE(opline) == IS_CONST) { -#if ZEND_EXTENSION_API_NO > PHP_5_6_X_API_NO - int should_jmp = zend_is_true(&ZEND_OP1_LITERAL(opline) TSRMLS_CC); -#else int should_jmp = zend_is_true(&ZEND_OP1_LITERAL(opline)); -#endif if (opline->opcode == ZEND_JMPZ_EX) { should_jmp = !should_jmp; } @@ -107,11 +103,7 @@ if (ZEND_OPTIMIZER_PASS_2 & OPTIMIZATION_LEVEL) { case ZEND_JMPZ: case ZEND_JMPNZ: if (ZEND_OP1_TYPE(opline) == IS_CONST) { -#if ZEND_EXTENSION_API_NO > PHP_5_6_X_API_NO - int should_jmp = zend_is_true(&ZEND_OP1_LITERAL(opline) TSRMLS_CC); -#else int should_jmp = zend_is_true(&ZEND_OP1_LITERAL(opline)); -#endif if (opline->opcode == ZEND_JMPZ) { should_jmp = !should_jmp; @@ -147,11 +139,8 @@ if (ZEND_OPTIMIZER_PASS_2 & OPTIMIZATION_LEVEL) { case ZEND_JMPZNZ: if (ZEND_OP1_TYPE(opline) == IS_CONST) { int opline_num; -#if ZEND_EXTENSION_API_NO > PHP_5_6_X_API_NO - if (zend_is_true(&ZEND_OP1_LITERAL(opline) TSRMLS_CC)) { -#else + if (zend_is_true(&ZEND_OP1_LITERAL(opline))) { -#endif opline_num = opline->extended_value; /* JMPNZ */ } else { opline_num = ZEND_OP2(opline).opline_num; /* JMPZ */ diff --git b/ext/opcache/ZendAccelerator.c a/ext/opcache/ZendAccelerator.c index d1c9dfc..45c0cf6 100644 --- b/ext/opcache/ZendAccelerator.c +++ a/ext/opcache/ZendAccelerator.c @@ -2550,11 +2550,7 @@ static int accel_startup(zend_extension *extension) _setmaxstdio(2048); /* The default configuration is limited to 512 stdio files */ #endif -#if ZEND_EXTENSION_API_NO > PHP_5_6_X_API_NO - if (start_accel_module(TSRMLS_C) == FAILURE) { -#else if (start_accel_module() == FAILURE) { -#endif accel_startup_ok = 0; zend_error(E_WARNING, ACCELERATOR_PRODUCT_NAME ": module registration failed!"); return FAILURE; diff --git b/ext/opcache/ZendAccelerator.h a/ext/opcache/ZendAccelerator.h index 169a751..b1f8193 100644 --- b/ext/opcache/ZendAccelerator.h +++ a/ext/opcache/ZendAccelerator.h @@ -92,7 +92,6 @@ #define PHP_5_3_X_API_NO 220090626 #define PHP_5_4_X_API_NO 220100525 #define PHP_5_5_X_API_NO 220121212 -#define PHP_5_6_X_API_NO 220131106 /*** file locking ***/ #ifndef ZEND_WIN32 diff --git b/ext/opcache/zend_accelerator_module.c a/ext/opcache/zend_accelerator_module.c index b98623e..83e7d4c 100644 --- b/ext/opcache/zend_accelerator_module.c +++ a/ext/opcache/zend_accelerator_module.c @@ -474,17 +474,10 @@ static zend_module_entry accel_module_entry = { STANDARD_MODULE_PROPERTIES }; -#if ZEND_EXTENSION_API_NO > PHP_5_6_X_API_NO -int start_accel_module(TSRMLS_D) -{ - return zend_startup_module(&accel_module_entry TSRMLS_CC); -} -#else int start_accel_module(void) { return zend_startup_module(&accel_module_entry); } -#endif /* {{{ proto array accelerator_get_scripts() Get the scripts which are accelerated by ZendAccelerator */ diff --git b/ext/opcache/zend_accelerator_module.h a/ext/opcache/zend_accelerator_module.h index 6e772b8..ece4a7d 100644 --- b/ext/opcache/zend_accelerator_module.h +++ a/ext/opcache/zend_accelerator_module.h @@ -22,12 +22,7 @@ #ifndef ZEND_ACCELERATOR_MODULE_H #define ZEND_ACCELERATOR_MODULE_H -#if ZEND_EXTENSION_API_NO > PHP_5_6_X_API_NO -int start_accel_module(TSRMLS_D); -#else int start_accel_module(void); -#endif - void zend_accel_override_file_functions(TSRMLS_D); #endif /* _ZEND_ACCELERATOR_MODULE_H */ diff --git b/ext/openssl/xp_ssl.c a/ext/openssl/xp_ssl.c index 244f04d..631d475 100644 --- b/ext/openssl/xp_ssl.c +++ a/ext/openssl/xp_ssl.c @@ -926,7 +926,7 @@ static char * get_sni(php_stream_context *ctx, const char *resourcename, size_t if (ctx) { zval **val = NULL; - if (php_stream_context_get_option(ctx, "ssl", "SNI_enabled", &val) == SUCCESS && !zend_is_true(*val TSRMLS_CC)) { + if (php_stream_context_get_option(ctx, "ssl", "SNI_enabled", &val) == SUCCESS && !zend_is_true(*val)) { return NULL; } if (php_stream_context_get_option(ctx, "ssl", "SNI_server_name", &val) == SUCCESS) { diff --git b/ext/pcntl/pcntl.c a/ext/pcntl/pcntl.c index 4c7f178..b7ef4c7 100644 --- b/ext/pcntl/pcntl.c +++ a/ext/pcntl/pcntl.c @@ -499,7 +499,7 @@ PHP_MINIT_FUNCTION(pcntl) { php_register_signal_constants(INIT_FUNC_ARGS_PASSTHRU); php_pcntl_register_errno_constants(INIT_FUNC_ARGS_PASSTHRU); - php_add_tick_function(pcntl_signal_dispatch TSRMLS_CC); + php_add_tick_function(pcntl_signal_dispatch); return SUCCESS; } diff --git b/ext/soap/php_encoding.c a/ext/soap/php_encoding.c index 12f23bf..32e8851 100644 --- b/ext/soap/php_encoding.c +++ a/ext/soap/php_encoding.c @@ -1189,7 +1189,7 @@ static xmlNodePtr to_xml_bool(encodeTypePtr type, zval *data, int style, xmlNode xmlAddChild(parent, ret); FIND_ZVAL_NULL(data, ret, style); - if (zend_is_true(data TSRMLS_CC)) { + if (zend_is_true(data)) { xmlNodeSetContent(ret, BAD_CAST("true")); } else { xmlNodeSetContent(ret, BAD_CAST("false")); diff --git b/ext/spl/spl_array.c a/ext/spl/spl_array.c index 9270132..f41d0fb 100644 --- b/ext/spl/spl_array.c +++ a/ext/spl/spl_array.c @@ -599,7 +599,7 @@ static int spl_array_has_dimension_ex(int check_inherited, zval *object, zval *o SEPARATE_ARG_IF_REF(offset); zend_call_method_with_1_params(&object, Z_OBJCE_P(object), &intern->fptr_offset_has, "offsetExists", &rv, offset); zval_ptr_dtor(&offset); - if (rv && zend_is_true(rv TSRMLS_CC)) { + if (rv && zend_is_true(rv)) { zval_ptr_dtor(&rv); return 1; } @@ -620,7 +620,7 @@ static int spl_array_has_dimension_ex(int check_inherited, zval *object, zval *o case 2: return 1; default: - return zend_is_true(*tmp TSRMLS_CC); + return zend_is_true(*tmp); } } } @@ -643,7 +643,7 @@ static int spl_array_has_dimension_ex(int check_inherited, zval *object, zval *o case 2: return 1; default: - return zend_is_true(*tmp TSRMLS_CC); + return zend_is_true(*tmp); } } return 0; diff --git b/ext/spl/spl_directory.c a/ext/spl/spl_directory.c index 4abbdf9..5f32fea 100644 --- b/ext/spl/spl_directory.c +++ a/ext/spl/spl_directory.c @@ -836,7 +836,7 @@ SPL_METHOD(DirectoryIterator, seek) int valid = 0; zend_call_method_with_0_params(&this_ptr, Z_OBJCE_P(getThis()), &intern->u.dir.func_valid, "valid", &retval); if (retval) { - valid = zend_is_true(retval TSRMLS_CC); + valid = zend_is_true(retval); zval_ptr_dtor(&retval); } if (!valid) { @@ -1497,7 +1497,7 @@ SPL_METHOD(RecursiveDirectoryIterator, hasChildren) spl_filesystem_object_get_file_name(intern TSRMLS_CC); if (!allow_links && !(intern->flags & SPL_FILE_DIR_FOLLOW_SYMLINKS)) { php_stat(intern->file_name, intern->file_name_len, FS_IS_LINK, return_value TSRMLS_CC); - if (zend_is_true(return_value TSRMLS_CC)) { + if (zend_is_true(return_value)) { RETURN_FALSE; } } diff --git b/ext/spl/spl_fixedarray.c a/ext/spl/spl_fixedarray.c index dcd1582..0519eda 100644 --- b/ext/spl/spl_fixedarray.c +++ a/ext/spl/spl_fixedarray.c @@ -511,7 +511,7 @@ static inline int spl_fixedarray_object_has_dimension_helper(spl_fixedarray_obje if (!intern->array->elements[index]) { retval = 0; } else if (check_empty) { - if (zend_is_true(intern->array->elements[index] TSRMLS_CC)) { + if (zend_is_true(intern->array->elements[index])) { retval = 1; } else { retval = 0; @@ -540,7 +540,7 @@ static int spl_fixedarray_object_has_dimension(zval *object, zval *offset, int c zval_ptr_dtor(&intern->retval); MAKE_STD_ZVAL(intern->retval); ZVAL_ZVAL(intern->retval, rv, 1, 1); - return zend_is_true(intern->retval TSRMLS_CC); + return zend_is_true(intern->retval); } return 0; } diff --git b/ext/spl/spl_iterators.c a/ext/spl/spl_iterators.c index 867f5e4..a89fd54 100644 --- b/ext/spl/spl_iterators.c +++ a/ext/spl/spl_iterators.c @@ -249,7 +249,7 @@ next_step: } } if (retval) { - has_children = zend_is_true(retval TSRMLS_CC); + has_children = zend_is_true(retval); zval_ptr_dtor(&retval); if (has_children) { if (object->max_depth == -1 || object->max_depth > object->level) { @@ -1774,7 +1774,7 @@ static inline void spl_filter_it_fetch(zval *zthis, spl_dual_it_object *intern T while (spl_dual_it_fetch(intern, 1 TSRMLS_CC) == SUCCESS) { zend_call_method_with_0_params(&zthis, intern->std.ce, NULL, "accept", &retval); if (retval) { - if (zend_is_true(retval TSRMLS_CC)) { + if (zend_is_true(retval)) { zval_ptr_dtor(&retval); return; } @@ -2598,7 +2598,7 @@ static inline void spl_caching_it_next(spl_dual_it_object *intern TSRMLS_DC) return; } } else { - if (zend_is_true(retval TSRMLS_CC)) { + if (zend_is_true(retval)) { zend_call_method_with_0_params(&intern->inner.zobject, intern->inner.ce, NULL, "getchildren", &zchildren); if (EG(exception)) { if (zchildren) { @@ -3573,7 +3573,7 @@ static int spl_iterator_func_apply(zend_object_iterator *iter, void *puser TSRML apply_info->count++; zend_fcall_info_call(&apply_info->fci, &apply_info->fcc, &retval, NULL TSRMLS_CC); if (retval) { - result = zend_is_true(retval TSRMLS_CC) ? ZEND_HASH_APPLY_KEEP : ZEND_HASH_APPLY_STOP; + result = zend_is_true(retval) ? ZEND_HASH_APPLY_KEEP : ZEND_HASH_APPLY_STOP; zval_ptr_dtor(&retval); } else { result = ZEND_HASH_APPLY_STOP; diff --git b/ext/standard/array.c a/ext/standard/array.c index 6642bc2..e84e019 100644 --- b/ext/standard/array.c +++ a/ext/standard/array.c @@ -4277,7 +4277,7 @@ PHP_FUNCTION(array_filter) fci.params = args; if (zend_call_function(&fci, &fci_cache TSRMLS_CC) == SUCCESS && retval) { - int retval_true = zend_is_true(retval TSRMLS_CC); + int retval_true = zend_is_true(retval); zval_ptr_dtor(&retval); if (use_type) { @@ -4290,7 +4290,7 @@ PHP_FUNCTION(array_filter) php_error_docref(NULL TSRMLS_CC, E_WARNING, "An error occurred while invoking the filter callback"); return; } - } else if (!zend_is_true(*operand TSRMLS_CC)) { + } else if (!zend_is_true(*operand)) { continue; } diff --git b/ext/standard/basic_functions.c a/ext/standard/basic_functions.c index 4604f60..7064797 100644 --- b/ext/standard/basic_functions.c +++ a/ext/standard/basic_functions.c @@ -5751,7 +5751,7 @@ PHP_FUNCTION(register_tick_function) zend_llist_init(BG(user_tick_functions), sizeof(user_tick_function_entry), (llist_dtor_func_t) user_tick_function_dtor, 0); - php_add_tick_function(run_user_tick_functions TSRMLS_CC); + php_add_tick_function(run_user_tick_functions); } for (i = 0; i < tick_fe.arg_count; i++) { diff --git b/ext/standard/ftp_fopen_wrapper.c a/ext/standard/ftp_fopen_wrapper.c index df03772..d6eb3b8 100644 --- b/ext/standard/ftp_fopen_wrapper.c +++ a/ext/standard/ftp_fopen_wrapper.c @@ -163,7 +163,7 @@ static php_stream *php_ftp_fopen_connect(php_stream_wrapper *wrapper, const char goto connect_errexit; } - php_stream_context_set(stream, context TSRMLS_CC); + php_stream_context_set(stream, context); php_stream_notify_info(context, PHP_STREAM_NOTIFY_CONNECT, NULL, 0); /* Start talking to ftp server */ @@ -571,7 +571,7 @@ php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, const char *pa goto errexit; } - php_stream_context_set(datastream, context TSRMLS_CC); + php_stream_context_set(datastream, context); php_stream_notify_progress_init(context, 0, file_size); if (use_ssl_on_data && (php_stream_xport_crypto_setup(datastream, @@ -745,7 +745,7 @@ php_stream * php_stream_ftp_opendir(php_stream_wrapper *wrapper, const char *pat goto opendir_errexit; } - php_stream_context_set(datastream, context TSRMLS_CC); + php_stream_context_set(datastream, context); if (use_ssl_on_data && (php_stream_xport_crypto_setup(stream, STREAM_CRYPTO_METHOD_SSLv23_CLIENT, NULL TSRMLS_CC) < 0 || diff --git b/ext/standard/http_fopen_wrapper.c a/ext/standard/http_fopen_wrapper.c index 3ef722b..73776ff 100644 --- b/ext/standard/http_fopen_wrapper.c +++ a/ext/standard/http_fopen_wrapper.c @@ -337,7 +337,7 @@ finish: eol_detect = stream->flags & (PHP_STREAM_FLAG_DETECT_EOL | PHP_STREAM_FLAG_EOL_MAC); stream->flags &= ~(PHP_STREAM_FLAG_DETECT_EOL | PHP_STREAM_FLAG_EOL_MAC); - php_stream_context_set(stream, context TSRMLS_CC); + php_stream_context_set(stream, context); php_stream_notify_info(context, PHP_STREAM_NOTIFY_CONNECT, NULL, 0); @@ -682,7 +682,7 @@ finish: response_code = 0; } if (context && SUCCESS==php_stream_context_get_option(context, "http", "ignore_errors", &tmpzval)) { - ignore_errors = zend_is_true(*tmpzval TSRMLS_CC); + ignore_errors = zend_is_true(*tmpzval); } /* when we request only the header, don't fail even on error codes */ if ((options & STREAM_ONLY_GET_HEADERS) || ignore_errors) { diff --git b/ext/standard/type.c a/ext/standard/type.c index 15bdbb0..dcc8083 100644 --- b/ext/standard/type.c +++ a/ext/standard/type.c @@ -186,7 +186,7 @@ PHP_FUNCTION(boolval) return; } - RETURN_BOOL(zend_is_true(*val TSRMLS_CC)); + RETURN_BOOL(zend_is_true(*val)); } /* }}} */ diff --git b/ext/xsl/php_xsl.c a/ext/xsl/php_xsl.c index aac93cd..3d63dd0 100644 --- b/ext/xsl/php_xsl.c +++ a/ext/xsl/php_xsl.c @@ -57,8 +57,8 @@ zend_module_entry xsl_module_entry = { xsl_functions, PHP_MINIT(xsl), PHP_MSHUTDOWN(xsl), - NULL, - NULL, + PHP_RINIT(xsl), /* Replace with NULL if there's nothing to do at request start */ + PHP_RSHUTDOWN(xsl), /* Replace with NULL if there's nothing to do at request end */ PHP_MINFO(xsl), #if ZEND_MODULE_API_NO >= 20010901 "0.1", /* Replace with version number for your extension */ @@ -170,7 +170,6 @@ PHP_MINIT_FUNCTION(xsl) xsltRegisterExtModuleFunction ((const xmlChar *) "function", (const xmlChar *) "http://php.net/xsl", xsl_ext_function_object_php); - xsltSetGenericErrorFunc(NULL, php_libxml_error_handler); REGISTER_LONG_CONSTANT("XSL_CLONE_AUTO", 0, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("XSL_CLONE_NEVER", -1, CONST_CS | CONST_PERSISTENT); @@ -274,7 +273,7 @@ PHP_MSHUTDOWN_FUNCTION(xsl) (const xmlChar *) "http://php.net/xsl"); xsltUnregisterExtModuleFunction ((const xmlChar *) "function", (const xmlChar *) "http://php.net/xsl"); - xsltSetGenericErrorFunc(NULL, NULL); + xsltCleanupGlobals(); UNREGISTER_INI_ENTRIES(); @@ -283,6 +282,24 @@ PHP_MSHUTDOWN_FUNCTION(xsl) } /* }}} */ +/* {{{ PHP_RINIT_FUNCTION + */ +PHP_RINIT_FUNCTION(xsl) +{ + xsltSetGenericErrorFunc(NULL, php_libxml_error_handler); + return SUCCESS; +} +/* }}} */ + +/* {{{ PHP_RSHUTDOWN_FUNCTION + */ +PHP_RSHUTDOWN_FUNCTION(xsl) +{ + xsltSetGenericErrorFunc(NULL, NULL); + return SUCCESS; +} +/* }}} */ + /* {{{ PHP_MINFO_FUNCTION */ PHP_MINFO_FUNCTION(xsl) diff --git b/main/SAPI.c a/main/SAPI.c index f9e4a9f..b182909 100644 --- b/main/SAPI.c +++ a/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 b/main/SAPI.h a/main/SAPI.h index 71942f5..a2158a9 100644 --- b/main/SAPI.h +++ a/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 TSRMLS_DC); + void (*flush)(void *server_context); struct stat *(*get_stat)(TSRMLS_D); char *(*getenv)(char *name, size_t name_len TSRMLS_DC); diff --git b/main/main.c a/main/main.c index ebb158a..2d59c46 100644 --- b/main/main.c +++ a/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) TSRMLS_CC); + return zend_set_memory_limit(PG(memory_limit)); } /* }}} */ @@ -460,6 +460,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 { + *p = (signed char) atoi(new_value); + } + return SUCCESS; +} +/* }}} */ /* Need to be read from the environment (?): * PHP_AUTO_PREPEND_FILE @@ -562,6 +596,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) @@ -1166,7 +1201,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) TSRMLS_CC); + zend_set_memory_limit(PG(memory_limit)); efree(buffer); zend_objects_store_mark_destructed(&EG(objects_store) TSRMLS_CC); zend_bailout(); @@ -1793,7 +1828,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; @@ -1803,34 +1838,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(); @@ -2643,9 +2678,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 b/main/php.h a/main/php.h index c2d0d93..8f8ad33 100644 --- b/main/php.h +++ a/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 diff --git b/main/php_content_types.c a/main/php_content_types.c index c8db921..bc42c80 100644 --- b/main/php_content_types.c +++ a/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 b/main/php_globals.h a/main/php_globals.h index b8f64d6..cf7998b 100644 --- b/main/php_globals.h +++ a/main/php_globals.h @@ -131,6 +131,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 b/main/php_ini.c a/main/php_ini.c index 3bcb249..1faec68 100644 --- b/main/php_ini.c +++ a/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 TSRMLS_CC); + zend_load_extension(filename); } 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 TSRMLS_CC); + zend_load_extension(libpath); efree(libpath); } } diff --git b/main/php_ticks.c a/main/php_ticks.c index 248b5a9..b07f925 100644 --- b/main/php_ticks.c +++ a/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 b/main/php_ticks.h a/main/php_ticks.h index b511949..0f58ada 100644 --- b/main/php_ticks.h +++ a/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 b/main/php_variables.c a/main/php_variables.c index 38cf043..f529898 100644 --- b/main/php_variables.c +++ a/main/php_variables.c @@ -734,7 +734,6 @@ 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 b/main/php_version.h a/main/php_version.h index 87c2e4a..d48bf13 100644 --- b/main/php_version.h +++ a/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 b/main/streams/php_stream_context.h a/main/streams/php_stream_context.h index 5c6925a..58b298b 100644 --- b/main/streams/php_stream_context.h +++ a/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 TSRMLS_DC); +PHPAPI php_stream_context *php_stream_context_set(php_stream *stream, php_stream_context *context); END_EXTERN_C() #define php_stream_notify_info(context, code, xmsg, xcode) do { if ((context) && (context)->notifier) { \ diff --git b/main/streams/streams.c a/main/streams/streams.c index 4c4764c..4713db1 100644 --- b/main/streams/streams.c +++ a/main/streams/streams.c @@ -2148,9 +2148,10 @@ 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 TSRMLS_DC) +PHPAPI php_stream_context *php_stream_context_set(php_stream *stream, php_stream_context *context) { php_stream_context *oldcontext = stream->context; + TSRMLS_FETCH(); stream->context = context; diff --git b/main/streams/transports.c a/main/streams/transports.c index f54e8e6..a633b05 100644 --- b/main/streams/transports.c +++ a/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 TSRMLS_CC); + php_stream_context_set(stream, context); if ((flags & STREAM_XPORT_SERVER) == 0) { /* client */ diff --git b/main/streams/userspace.c a/main/streams/userspace.c index 7d95872..5990464 100644 --- b/main/streams/userspace.c +++ a/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 TSRMLS_CC)) { + } else if (retval && zend_is_true(retval)) { 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 TSRMLS_CC)) { + if (retval == NULL || !zend_is_true(retval)) { break; } php_stream_from_zval_no_verify(intstream, &retval); diff --git b/php.ini-development a/php.ini-development index df39e42..4fbd07f 100644 --- b/php.ini-development +++ a/php.ini-development @@ -692,6 +692,13 @@ default_mimetype = "text/html" ; http://php.net/default-charset ;default_charset = "UTF-8" +; Always populate the $HTTP_RAW_POST_DATA variable. PHP's default behavior is +; to disable this feature and it will be removed in a future version. +; If post reading is disabled through enable_post_data_reading, +; $HTTP_RAW_POST_DATA is *NOT* populated. +; http://php.net/always-populate-raw-post-data +;always_populate_raw_post_data = -1 + ;;;;;;;;;;;;;;;;;;;;;;;;; ; Paths and Directories ; ;;;;;;;;;;;;;;;;;;;;;;;;; diff --git b/php.ini-production a/php.ini-production index cff1a3b..53f0b51 100644 --- b/php.ini-production +++ a/php.ini-production @@ -692,6 +692,13 @@ default_mimetype = "text/html" ; http://php.net/default-charset ;default_charset = "UTF-8" +; Always populate the $HTTP_RAW_POST_DATA variable. PHP's default behavior is +; to disable this feature and it will be removed in a future version. +; If post reading is disabled through enable_post_data_reading, +; $HTTP_RAW_POST_DATA is *NOT* populated. +; http://php.net/always-populate-raw-post-data +;always_populate_raw_post_data = -1 + ;;;;;;;;;;;;;;;;;;;;;;;;; ; Paths and Directories ; ;;;;;;;;;;;;;;;;;;;;;;;;; diff --git b/sapi/apache/mod_php5.c a/sapi/apache/mod_php5.c index 37252e1..a1e5a70 100644 --- b/sapi/apache/mod_php5.c +++ a/sapi/apache/mod_php5.c @@ -108,7 +108,7 @@ static int sapi_apache_ub_write(const char *str, uint str_length TSRMLS_DC) /* {{{ sapi_apache_flush */ -static void sapi_apache_flush(void *server_context TSRMLS_DC) +static void sapi_apache_flush(void *server_context) { if (server_context) { #if MODULE_MAGIC_NUMBER > 19970110 diff --git b/sapi/apache2filter/sapi_apache2.c a/sapi/apache2filter/sapi_apache2.c index 6b56e78..da920f8 100644 --- b/sapi/apache2filter/sapi_apache2.c +++ a/sapi/apache2filter/sapi_apache2.c @@ -245,13 +245,14 @@ php_apache_sapi_register_variables(zval *track_vars_array TSRMLS_DC) } static void -php_apache_sapi_flush(void *server_context TSRMLS_DC) +php_apache_sapi_flush(void *server_context) { php_struct *ctx; apr_bucket_brigade *bb; apr_bucket_alloc_t *ba; apr_bucket *b; ap_filter_t *f; /* output filters */ + TSRMLS_FETCH(); ctx = server_context; diff --git b/sapi/apache2handler/sapi_apache2.c a/sapi/apache2handler/sapi_apache2.c index 37d862f..d2b3a32 100644 --- b/sapi/apache2handler/sapi_apache2.c +++ a/sapi/apache2handler/sapi_apache2.c @@ -287,10 +287,11 @@ php_apache_sapi_register_variables(zval *track_vars_array TSRMLS_DC) } static void -php_apache_sapi_flush(void *server_context TSRMLS_DC) +php_apache_sapi_flush(void *server_context) { php_struct *ctx; request_rec *r; + TSRMLS_FETCH(); ctx = server_context; diff --git b/sapi/apache_hooks/mod_php5.c a/sapi/apache_hooks/mod_php5.c index 901d3b5..a069e32 100644 --- b/sapi/apache_hooks/mod_php5.c +++ a/sapi/apache_hooks/mod_php5.c @@ -253,7 +253,7 @@ static int sapi_apache_ub_write(const char *str, uint str_length TSRMLS_DC) /* {{{ sapi_apache_flush */ -static void sapi_apache_flush(void *server_context TSRMLS_DC) +static void sapi_apache_flush(void *server_context) { if (server_context) { #if MODULE_MAGIC_NUMBER > 19970110 diff --git b/sapi/apache_hooks/php_apache.c a/sapi/apache_hooks/php_apache.c index 76a4219..6531ca2 100644 --- b/sapi/apache_hooks/php_apache.c +++ a/sapi/apache_hooks/php_apache.c @@ -155,13 +155,15 @@ static request_rec *get_apache_request(zval *z TSRMLS_DC) return r; } -/* {{{ php_apache_request_new(request_rec *r TSRMLS_DC) +/* {{{ php_apache_request_new(request_rec *r) * create a new zval-instance for ApacheRequest that wraps request_rec */ -zval *php_apache_request_new(request_rec *r TSRMLS_DC) +zval *php_apache_request_new(request_rec *r) { zval *req; zval *addr; + + TSRMLS_FETCH(); MAKE_STD_ZVAL(addr); Z_TYPE_P(addr) = IS_LONG; @@ -1168,7 +1170,7 @@ PHP_FUNCTION(apache_request_sub_req_lookup_uri) if (!sub_r) { RETURN_FALSE; } - return_value = php_apache_request_new(sub_r TSRMLS_CC); + return_value = php_apache_request_new(sub_r); } /* }}} */ @@ -1194,7 +1196,7 @@ PHP_FUNCTION(apache_request_sub_req_lookup_file) if (!sub_r) { RETURN_FALSE; } - return_value = php_apache_request_new(sub_r TSRMLS_CC); + return_value = php_apache_request_new(sub_r); } /* }}} */ @@ -1220,7 +1222,7 @@ PHP_FUNCTION(apache_request_sub_req_method_uri) if (!sub_r) { RETURN_FALSE; } - return_value = php_apache_request_new(sub_r TSRMLS_CC); + return_value = php_apache_request_new(sub_r); } /* }}} */ diff --git b/sapi/caudium/caudium.c a/sapi/caudium/caudium.c index 946f7a0..e707f35 100644 --- b/sapi/caudium/caudium.c +++ a/sapi/caudium/caudium.c @@ -395,10 +395,11 @@ php_caudium_sapi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) * the client. Used for POST/PUT requests. */ -INLINE static int php_caudium_low_read_post(char *buf, uint count_bytes TSRMLS_DC) +INLINE static int php_caudium_low_read_post(char *buf, uint count_bytes) { uint total_read = 0; GET_THIS(); + TSRMLS_FETCH(); if(!MY_FD_OBJ->prog) { @@ -422,7 +423,7 @@ static int php_caudium_sapi_read_post(char *buf, uint count_bytes TSRMLS_DC) { uint total_read = 0; - THREAD_SAFE_RUN(total_read = php_caudium_low_read_post(buf, count_bytes TSRMLS_CC), "read post"); + THREAD_SAFE_RUN(total_read = php_caudium_low_read_post(buf, count_bytes), "read post"); return total_read; } diff --git b/sapi/cgi/cgi_main.c a/sapi/cgi/cgi_main.c index 5b22fa5..f464e1e 100644 --- b/sapi/cgi/cgi_main.c +++ a/sapi/cgi/cgi_main.c @@ -324,14 +324,14 @@ static int sapi_fcgi_ub_write(const char *str, uint str_length TSRMLS_DC) return str_length; } -static void sapi_cgi_flush(void *server_context TSRMLS_DC) +static void sapi_cgi_flush(void *server_context) { if (fflush(stdout) == EOF) { php_handle_aborted_connection(); } } -static void sapi_fcgi_flush(void *server_context TSRMLS_DC) +static void sapi_fcgi_flush(void *server_context) { fcgi_request *request = (fcgi_request*) server_context; @@ -928,7 +928,7 @@ static int sapi_cgi_deactivate(TSRMLS_D) php_handle_aborted_connection(); } } else { - sapi_cgi_flush(SG(server_context) TSRMLS_CC); + sapi_cgi_flush(SG(server_context)); } } return SUCCESS; @@ -2240,7 +2240,7 @@ consult the installation file that came with this distribution, or visit \n\ break; case 'z': /* load extension file */ - zend_load_extension(php_optarg TSRMLS_CC); + zend_load_extension(php_optarg); break; default: @@ -2493,7 +2493,7 @@ consult the installation file that came with this distribution, or visit \n\ /* Zeev might want to do something with this one day */ case PHP_MODE_INDENT: open_file_for_scanning(&file_handle TSRMLS_CC); - zend_indent(TSRMLS_C); + zend_indent(); zend_file_handle_dtor(&file_handle TSRMLS_CC); php_output_teardown(); return SUCCESS; diff --git b/sapi/cli/php_cli.c a/sapi/cli/php_cli.c index 7c97117..9daa382 100644 --- b/sapi/cli/php_cli.c +++ a/sapi/cli/php_cli.c @@ -320,7 +320,7 @@ static int sapi_cli_ub_write(const char *str, uint str_length TSRMLS_DC) /* {{{ } /* }}} */ -static void sapi_cli_flush(void *server_context TSRMLS_DC) /* {{{ */ +static void sapi_cli_flush(void *server_context) /* {{{ */ { /* Ignore EBADF here, it's caused by the fact that STDIN/STDOUT/STDERR streams * are/could be closed before fflush() is called. @@ -870,7 +870,7 @@ static int do_cli(int argc, char **argv TSRMLS_DC) /* {{{ */ break; case 'z': /* load extension file */ - zend_load_extension(php_optarg TSRMLS_CC); + zend_load_extension(php_optarg); break; case 'H': hide_argv = 1; @@ -1024,7 +1024,7 @@ static int do_cli(int argc, char **argv TSRMLS_DC) /* {{{ */ /* Zeev might want to do something with this one day */ case PHP_MODE_INDENT: open_file_for_scanning(&file_handle TSRMLS_CC); - zend_indent(TSRMLS_C); + zend_indent(); zend_file_handle_dtor(file_handle.handle TSRMLS_CC); goto out; break; diff --git b/sapi/cli/php_cli_server.c a/sapi/cli/php_cli_server.c index 2c68fa1..3f2aaf0 100644 --- b/sapi/cli/php_cli_server.c +++ a/sapi/cli/php_cli_server.c @@ -614,9 +614,10 @@ static int sapi_cli_server_ub_write(const char *str, uint str_length TSRMLS_DC) return php_cli_server_client_send_through(client, str, str_length); } /* }}} */ -static void sapi_cli_server_flush(void *server_context TSRMLS_DC) /* {{{ */ +static void sapi_cli_server_flush(void *server_context) /* {{{ */ { php_cli_server_client *client = server_context; + TSRMLS_FETCH(); if (!client) { return; @@ -1143,7 +1144,7 @@ static int php_cli_server_content_sender_send(php_cli_server_content_sender *sen return 0; } /* }}} */ -static int php_cli_server_content_sender_pull(php_cli_server_content_sender *sender, int fd, size_t *nbytes_read TSRMLS_DC) /* {{{ */ +static int php_cli_server_content_sender_pull(php_cli_server_content_sender *sender, int fd, size_t *nbytes_read) /* {{{ */ { ssize_t _nbytes_read; php_cli_server_chunk *chunk = php_cli_server_chunk_heap_new_self_contained(131072); @@ -1151,6 +1152,7 @@ static int php_cli_server_content_sender_pull(php_cli_server_content_sender *sen _nbytes_read = read(fd, chunk->data.heap.p, chunk->data.heap.len); if (_nbytes_read < 0) { char *errstr = get_last_error(); + TSRMLS_FETCH(); php_cli_server_logf("%s" TSRMLS_CC, errstr); pefree(errstr, 1); php_cli_server_chunk_dtor(chunk); @@ -2366,7 +2368,7 @@ static int php_cli_server_send_event(php_cli_server *server, php_cli_server_clie if (client->content_sender_initialized) { if (client->file_fd >= 0 && !client->content_sender.buffer.first) { size_t nbytes_read; - if (php_cli_server_content_sender_pull(&client->content_sender, client->file_fd, &nbytes_read TSRMLS_CC)) { + if (php_cli_server_content_sender_pull(&client->content_sender, client->file_fd, &nbytes_read)) { php_cli_server_close_connection(server, client TSRMLS_CC); return FAILURE; } diff --git b/sapi/continuity/capi.c a/sapi/continuity/capi.c index 87fd932..9539914 100644 --- b/sapi/continuity/capi.c +++ a/sapi/continuity/capi.c @@ -462,7 +462,7 @@ int phpFinit(lstTset * opt) core_globals = ts_resource(core_globals_id); logFmsg(0, "mod/php: PHP Interface v3 (module)"); - logFmsg(0, "mod/php: Copyright (c) 1999-2013 The PHP Group. All rights reserved."); + logFmsg(0, "mod/php: Copyright (c) 1999-2005 The PHP Group. All rights reserved."); sapi_startup(&capi_sapi_module); capi_sapi_module.startup(&capi_sapi_module); diff --git b/sapi/embed/php_embed.c a/sapi/embed/php_embed.c index b4fc5aa..dad54de 100644 --- b/sapi/embed/php_embed.c +++ a/sapi/embed/php_embed.c @@ -79,7 +79,7 @@ static int php_embed_ub_write(const char *str, uint str_length TSRMLS_DC) return str_length; } -static void php_embed_flush(void *server_context TSRMLS_DC) +static void php_embed_flush(void *server_context) { if (fflush(stdout)==EOF) { php_handle_aborted_connection(); diff --git b/sapi/fpm/fpm/fpm_main.c a/sapi/fpm/fpm/fpm_main.c index 807ea8b..9309083 100644 --- b/sapi/fpm/fpm/fpm_main.c +++ a/sapi/fpm/fpm/fpm_main.c @@ -316,7 +316,7 @@ static int sapi_cgibin_ub_write(const char *str, uint str_length TSRMLS_DC) } -static void sapi_cgibin_flush(void *server_context TSRMLS_DC) +static void sapi_cgibin_flush(void *server_context) { /* fpm has started, let use fcgi instead of stdout */ if (fpm_is_running) { diff --git b/sapi/litespeed/lsapi_main.c a/sapi/litespeed/lsapi_main.c index 850433d..33ebb98 100644 --- b/sapi/litespeed/lsapi_main.c +++ a/sapi/litespeed/lsapi_main.c @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: lsapi_main.c,v 1.59 2013/11/18 21:14:38 gwang Exp $ */ +/* $Id: lsapi_main.c,v 1.57 2013/08/23 14:50:25 gwang Exp $ */ #include "php.h" #include "SAPI.h" @@ -157,7 +157,7 @@ static int sapi_lsapi_ub_write(const char *str, uint str_length TSRMLS_DC) /* {{{ sapi_lsapi_flush */ -static void sapi_lsapi_flush( void * server_context TSRMLS_DC ) +static void sapi_lsapi_flush( void * server_context ) { if ( lsapi_mode ) { if ( LSAPI_Flush() == -1) { @@ -372,7 +372,7 @@ static void sapi_lsapi_log_message(char *message TSRMLS_DC) static sapi_module_struct lsapi_sapi_module = { "litespeed", - "LiteSpeed V6.6", + "LiteSpeed V6.4", php_lsapi_startup, /* startup */ php_module_shutdown_wrapper, /* shutdown */ diff --git b/sapi/litespeed/lsapilib.c a/sapi/litespeed/lsapilib.c index cdd6076..4a9affc 100644 --- b/sapi/litespeed/lsapilib.c +++ a/sapi/litespeed/lsapilib.c @@ -1211,7 +1211,6 @@ int LSAPI_IsRunning(void) int LSAPI_InitRequest( LSAPI_Request * pReq, int fd ) { - int newfd; if ( !pReq ) return -1; memset( pReq, 0, sizeof( LSAPI_Request ) ); @@ -1225,14 +1224,7 @@ int LSAPI_InitRequest( LSAPI_Request * pReq, int fd ) pReq->m_respPktHeaderEnd = &pReq->m_respPktHeader[5]; if ( allocateRespHeaderBuf( pReq, LSAPI_INIT_RESP_HEADER_LEN ) == -1 ) return -1; - - if ( fd == STDIN_FILENO ) - { - fd = dup( fd ); - newfd = open( "/dev/null", O_RDWR ); - dup2( newfd, STDIN_FILENO ); - } - + if ( isPipe( fd ) ) { pReq->m_fdListen = -1; @@ -2394,8 +2386,6 @@ typedef struct _lsapi_prefork_server int m_iAvoidFork; lsapi_child_status * m_pChildrenStatus; - lsapi_child_status * m_pChildrenStatusCur; - lsapi_child_status * m_pChildrenStatusEnd; }lsapi_prefork_server; @@ -2484,15 +2474,11 @@ static void lsapi_cleanup(int signal) static lsapi_child_status * find_child_status( int pid ) { lsapi_child_status * pStatus = g_prefork_server->m_pChildrenStatus; - lsapi_child_status * pEnd = g_prefork_server->m_pChildrenStatusEnd; + lsapi_child_status * pEnd = g_prefork_server->m_pChildrenStatus + g_prefork_server->m_iMaxChildren * 2; while( pStatus < pEnd ) { if ( pStatus->m_pid == pid ) - { - if ( pStatus + 1 > g_prefork_server->m_pChildrenStatusCur ) - g_prefork_server->m_pChildrenStatusCur = pStatus + 1; return pStatus; - } ++pStatus; } return NULL; @@ -2527,12 +2513,8 @@ static void lsapi_sigchild( int signal ) { child_status->m_pid = 0; --g_prefork_server->m_iCurChildren; - } } - while(( g_prefork_server->m_pChildrenStatusCur > g_prefork_server->m_pChildrenStatus ) - &&( g_prefork_server->m_pChildrenStatusCur[-1].m_pid == 0 )) - --g_prefork_server->m_pChildrenStatusCur; } @@ -2541,7 +2523,7 @@ static int lsapi_init_children_status() int size = 4096; char * pBuf; - size = (g_prefork_server->m_iMaxChildren + g_prefork_server->m_iExtraChildren ) * sizeof( lsapi_child_status ) * 2; + size = g_prefork_server->m_iMaxChildren * sizeof( lsapi_child_status ) * 2; size = (size + 4095 ) / 4096 * 4096; pBuf =( char*) mmap( NULL, size, PROT_READ | PROT_WRITE, MAP_ANON | MAP_SHARED, -1, 0 ); @@ -2551,9 +2533,7 @@ static int lsapi_init_children_status() return -1; } memset( pBuf, 0, size ); - g_prefork_server->m_pChildrenStatus = (lsapi_child_status *)pBuf; - g_prefork_server->m_pChildrenStatusCur = (lsapi_child_status *)pBuf; - g_prefork_server->m_pChildrenStatusEnd = (lsapi_child_status *)pBuf + size / sizeof( lsapi_child_status ); + g_prefork_server->m_pChildrenStatus = (lsapi_child_status *)pBuf; return 0; } @@ -2583,7 +2563,7 @@ static void lsapi_check_child_status( long tmCur ) int dying = 0; int count = 0; lsapi_child_status * pStatus = g_prefork_server->m_pChildrenStatus; - lsapi_child_status * pEnd = g_prefork_server->m_pChildrenStatusCur; + lsapi_child_status * pEnd = g_prefork_server->m_pChildrenStatus + g_prefork_server->m_iMaxChildren * 2; while( pStatus < pEnd ) { tobekilled = 0; @@ -2596,15 +2576,13 @@ static void lsapi_check_child_status( long tmCur ) if (( g_prefork_server->m_iCurChildren - dying > g_prefork_server->m_iMaxChildren)|| ( idle > g_prefork_server->m_iMaxIdleChildren )) { - ++pStatus->m_iKillSent; - //tobekilled = SIGUSR1; + tobekilled = SIGUSR1; } else { if (( s_max_idle_secs> 0)&&(tmCur - pStatus->m_tmWaitBegin > s_max_idle_secs + 5 )) { - ++pStatus->m_iKillSent; - //tobekilled = SIGUSR1; + tobekilled = SIGUSR1; } } if ( !tobekilled ) @@ -2738,8 +2716,6 @@ static int lsapi_prefork_server_accept( lsapi_prefork_server * pServer, LSAPI_Re if ( pServer->m_iCurChildren >= (pServer->m_iMaxChildren + pServer->m_iExtraChildren ) ) { - fprintf( stderr, "Reached max children process limit: %d, extra: %d, current: %d, please increase LSAPI_CHILDREN.\n", - pServer->m_iMaxChildren, pServer->m_iExtraChildren, pServer->m_iCurChildren ); usleep( 100000 ); continue; } @@ -2900,7 +2876,7 @@ int LSAPI_Prefork_Accept_r( LSAPI_Request * pReq ) { if ( !g_running ) return -1; - if ((s_req_processed)&&( s_pChildStatus )&&( s_pChildStatus->m_iKillSent )) + if (( s_pChildStatus )&&( s_pChildStatus->m_iKillSent )) return -1; FD_ZERO( &readfds ); FD_SET( fd, &readfds ); @@ -2928,7 +2904,7 @@ int LSAPI_Prefork_Accept_r( LSAPI_Request * pReq ) } else if ( ret >= 1 ) { - if (s_req_processed && ( s_pChildStatus )&&( s_pChildStatus->m_iKillSent )) + if (( s_pChildStatus )&&( s_pChildStatus->m_iKillSent )) return -1; if ( fd == pReq->m_fdListen ) { @@ -3090,8 +3066,6 @@ static int lsapi_initSuEXEC() { if ( g_prefork_server->m_iMaxChildren < 100 ) g_prefork_server->m_iMaxChildren = 100; - if ( g_prefork_server->m_iExtraChildren < 1000 ) - g_prefork_server->m_iExtraChildren = 1000; } } if ( !s_defaultUid || !s_defaultGid ) diff --git b/sapi/milter/php_milter.c a/sapi/milter/php_milter.c index e0b2d0a..432fd80 100644 --- b/sapi/milter/php_milter.c +++ a/sapi/milter/php_milter.c @@ -860,6 +860,10 @@ static int sapi_milter_ub_write(const char *str, uint str_length TSRMLS_DC) return str_length; } +static void sapi_milter_flush(void *server_context) +{ +} + static void sapi_milter_register_variables(zval *track_vars_array TSRMLS_DC) { php_register_variable ("SERVER_SOFTWARE", "Sendmail Milter", track_vars_array TSRMLS_CC); @@ -902,7 +906,7 @@ static sapi_module_struct milter_sapi_module = { NULL, /* deactivate */ sapi_milter_ub_write, /* unbuffered write */ - NULL, /* flush */ + sapi_milter_flush, /* flush */ NULL, /* get uid */ NULL, /* getenv */ @@ -1115,7 +1119,7 @@ int main(int argc, char *argv[]) break; case 'z': /* load extension file */ - zend_load_extension(ap_php_optarg TSRMLS_CC); + zend_load_extension(ap_php_optarg); break; default: diff --git b/sapi/nsapi/nsapi.c a/sapi/nsapi/nsapi.c index 5ed133c..ec3137c 100644 --- b/sapi/nsapi/nsapi.c +++ a/sapi/nsapi/nsapi.c @@ -467,9 +467,10 @@ static int sapi_nsapi_ub_write(const char *str, unsigned int str_length TSRMLS_D } /* modified version of apache2 */ -static void sapi_nsapi_flush(void *server_context TSRMLS_DC) +static void sapi_nsapi_flush(void *server_context) { nsapi_request_context *rc = (nsapi_request_context *)server_context; + TSRMLS_FETCH(); if (!rc) { /* we have no context, so no flushing needed. This fixes a SIGSEGV on shutdown */ diff --git b/sapi/pi3web/pi3web_sapi.c a/sapi/pi3web/pi3web_sapi.c index 0e17c0e..4bc08e5 100644 --- b/sapi/pi3web/pi3web_sapi.c +++ a/sapi/pi3web/pi3web_sapi.c @@ -385,7 +385,7 @@ MODULE_API DWORD PHP5_wrapper(LPCONTROL_BLOCK lpCB) } if ( open_file_for_scanning( &file_handle TSRMLS_CC ) == SUCCESS ) { - zend_indent(TSRMLS_C); + zend_indent(); } else { diff --git b/sapi/roxen/roxen.c a/sapi/roxen/roxen.c index 1445647..b3a6434 100644 --- b/sapi/roxen/roxen.c +++ a/sapi/roxen/roxen.c @@ -387,12 +387,13 @@ php_roxen_sapi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) * the client. Used for POST/PUT requests. */ -INLINE static int php_roxen_low_read_post(char *buf, uint count_bytes TSRMLS_DC) +INLINE static int php_roxen_low_read_post(char *buf, uint count_bytes) { uint total_read = 0; #ifdef ROXEN_USE_ZTS GET_THIS(); #endif + TSRMLS_FETCH(); if(!MY_FD_OBJ->prog) { @@ -416,7 +417,7 @@ static int php_roxen_sapi_read_post(char *buf, uint count_bytes TSRMLS_DC) { uint total_read = 0; - THREAD_SAFE_RUN(total_read = php_roxen_low_read_post(buf, count_bytes TSRMLS_CC), "read post"); + THREAD_SAFE_RUN(total_read = php_roxen_low_read_post(buf, count_bytes), "read post"); return total_read; } diff --git b/sapi/thttpd/thttpd.c a/sapi/thttpd/thttpd.c index f6ba858..843e4a6 100644 --- b/sapi/thttpd/thttpd.c +++ a/sapi/thttpd/thttpd.c @@ -349,12 +349,11 @@ static zend_module_entry php_thttpd_module = { STANDARD_MODULE_PROPERTIES }; -static int php_thttpd_startup(sapi_module_struct *sapi_module TSRMLS_DC) +static int php_thttpd_startup(sapi_module_struct *sapi_module) { #if PHP_API_VERSION >= 20020918 if (php_module_startup(sapi_module, &php_thttpd_module, 1) == FAILURE) { #else - /* No TSRMLS_CC here to zend_startup_module() as 5.6 and older does not have that parameter */ if (php_module_startup(sapi_module) == FAILURE || zend_startup_module(&php_thttpd_module) == FAILURE) { #endif diff --git b/sapi/tux/php_tux.c a/sapi/tux/php_tux.c index 9dba8ef..55d911f 100644 --- b/sapi/tux/php_tux.c +++ a/sapi/tux/php_tux.c @@ -96,7 +96,7 @@ static int sapi_tux_ub_write(const char *str, uint str_length TSRMLS_DC) return n; } -static int sapi_tux_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) +static int sapi_tux_send_headers(sapi_headers_struct *sapi_headers) { char buf[1024]; struct iovec *vec; @@ -107,6 +107,7 @@ static int sapi_tux_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) size_t len; char *status_line; int locate_cl; + TSRMLS_FETCH(); max_headers = 30; n = 1; @@ -157,10 +158,11 @@ static int sapi_tux_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) return SAPI_HEADER_SENT_SUCCESSFULLY; } -static int sapi_tux_read_post(char *buffer, uint count_bytes TSRMLS_DC) +static int sapi_tux_read_post(char *buffer, uint count_bytes) { #if 0 int amount = 0; + TSRMLS_FETCH(); TG(req)->objectlen = count_bytes; TG(req)->object_addr = buffer; @@ -175,8 +177,10 @@ static int sapi_tux_read_post(char *buffer, uint count_bytes TSRMLS_DC) #endif } -static char *sapi_tux_read_cookies(TSRMLS_D) +static char *sapi_tux_read_cookies(void) { + TSRMLS_FETCH(); + return TG(req)->cookies; } diff --git b/tests/basic/024.phpt a/tests/basic/024.phpt new file mode 100644 index 0000000..2e046c0 --- /dev/null +++ a/tests/basic/024.phpt @@ -0,0 +1,31 @@ +--TEST-- +Test HTTP_RAW_POST_DATA creation +--INI-- +always_populate_raw_post_data=1 +max_input_vars=1000 +--POST-- +a=ABC&y=XYZ&c[]=1&c[]=2&c[a]=3 +--FILE-- +<?php +var_dump($_POST, $HTTP_RAW_POST_DATA); +?> +--EXPECT-- +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. in Unknown on line 0 + +Warning: Cannot modify header information - headers already sent in Unknown on line 0 +array(3) { + ["a"]=> + string(3) "ABC" + ["y"]=> + string(3) "XYZ" + ["c"]=> + array(3) { + [0]=> + string(1) "1" + [1]=> + string(1) "2" + ["a"]=> + string(1) "3" + } +} +string(30) "a=ABC&y=XYZ&c[]=1&c[]=2&c[a]=3" diff --git b/tests/basic/024_1.phpt a/tests/basic/024_1.phpt new file mode 100644 index 0000000..f98af82 --- /dev/null +++ a/tests/basic/024_1.phpt @@ -0,0 +1,29 @@ +--TEST-- +Test HTTP_RAW_POST_DATA creation +--INI-- +always_populate_raw_post_data=-1 +max_input_vars=1000 +--POST-- +a=ABC&y=XYZ&c[]=1&c[]=2&c[a]=3 +--FILE-- +<?php +var_dump($_POST, $HTTP_RAW_POST_DATA); +?> +--EXPECTF-- +Notice: Undefined variable: HTTP_RAW_POST_DATA in %s on line %d +array(3) { + ["a"]=> + string(3) "ABC" + ["y"]=> + string(3) "XYZ" + ["c"]=> + array(3) { + [0]=> + string(1) "1" + [1]=> + string(1) "2" + ["a"]=> + string(1) "3" + } +} +NULL diff --git b/tests/basic/026.phpt a/tests/basic/026.phpt new file mode 100644 index 0000000..a3e34f4 --- /dev/null +++ a/tests/basic/026.phpt @@ -0,0 +1,18 @@ +--TEST-- +Registration of HTTP_RAW_POST_DATA due to unknown content-type +--INI-- +always_populate_raw_post_data=0 +--POST_RAW-- +Content-Type: unknown/type +a=1&b=ZYX +--FILE-- +<?php +var_dump($_POST, $HTTP_RAW_POST_DATA); +?> +--EXPECT-- +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. in Unknown on line 0 + +Warning: Cannot modify header information - headers already sent in Unknown on line 0 +array(0) { +} +string(9) "a=1&b=ZYX" diff --git b/tests/basic/026_1.phpt a/tests/basic/026_1.phpt new file mode 100644 index 0000000..527a795 --- /dev/null +++ a/tests/basic/026_1.phpt @@ -0,0 +1,16 @@ +--TEST-- +Registration of HTTP_RAW_POST_DATA due to unknown content-type +--INI-- +always_populate_raw_post_data=-1 +--POST_RAW-- +Content-Type: unknown/type +a=1&b=ZYX +--FILE-- +<?php +var_dump($_POST, $HTTP_RAW_POST_DATA); +?> +--EXPECTF-- +Notice: Undefined variable: HTTP_RAW_POST_DATA in %s on line %d +array(0) { +} +NULL
« previous php.cvs (#75685) next »