cataphract Wed, 22 Feb 2012 10:08:37 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=323423
Log: - Cleanup UPGRADING and UPGRADING.INTERNALS from 5.4 changes. - Added information about removal of streams pooling API. Changed paths: U php/php-src/trunk/UPGRADING U php/php-src/trunk/UPGRADING.INTERNALS
Modified: php/php-src/trunk/UPGRADING =================================================================== --- php/php-src/trunk/UPGRADING 2012-02-22 09:33:01 UTC (rev 323422) +++ php/php-src/trunk/UPGRADING 2012-02-22 10:08:37 UTC (rev 323423) @@ -36,57 +36,8 @@ 1. Changes made to default configuration ======================================== -- The default_charset setting now defaults to UTF-8. - It was ISO-88590-1 before, so if you were relying - on the default, you will need to add: +- - default_charset = iso-8859-1 - - to your php.ini to preserve pre-PHPX.Y behavior. - -- We now check at compile time if /dev/urandom or /dev/arandom - are present to provide non-blocking entropy to session id - generation. If either is present, session.entropy_file - now defaults to that file and session.entropy_length defaults - to 32. If you do not want extra entropy for your session ids - for some reason, add: - - session.entropy_file= - session.entropy_length=0 - - to your php.ini to preserve pre-PHPX.Y behavior. - -- Deprecated ini directives will now throw an E_CORE_WARNING's - instead of the previous E_WARNING's. - - The following directives are marked as deprecated: - - magic_quotes_gpc - - magic_quotes_runtime - - magic_quotes_sybase - -- The following directives, which indicates a removed feature - in PHP will now throw an E_CORE_ERROR upon startup like the - deprecation warnings. - - The following directives are no longer available: - - allow_call_time_pass_reference - - define_syslog_variables - - highlight.bg - - register_globals - - register_long_arrays - - safe_mode - - safe_mode_gid - - safe_mode_include_dir - - safe_mode_exec_dir - - safe_mode_allowed_env_vars - - safe_mode_protected_env_vars - - zend.ze1_compatibility_mode - -- the following new directives were added - - - max_input_vars - specifies how many GET/POST/COOKIE input variables may be - accepted. default value 1000. - ============================= 2. Reserved words and classes ============================= @@ -97,96 +48,13 @@ 3. Changes made to engine behaviour ============================= -- Turning null, false or empty string into an object by adding a property - will now emit a warning instead of an E_STRICT error. - - $test = null; - $test->baz = 1; - - To create a generic object you can use StdClass: - $test = new StdClass; - $test->baz = 1; +- -- In previous versions, names of superglobals could be used for parameter - names, thereby shadowing the corresponding superglobal. This now causes a - fatal error such as "Cannot re-assign auto-global variable GLOBALS". - ===================================== 4. Changes made to existing functions ===================================== -- array_combine now returns array() instead of FALSE when two empty arrays are - provided as parameters. -- Added an extra parameter to dns_get_record(), which allows requesting DNS - records by numeric type and makes the result include only the raw data of - the response. -- call_user_func_array no longer allows call-time pass by reference. -- htmlentities/htmlspecialchars are stricter in the code units they accept for - the asian encodings. For Big5-HKSCS, the octets 0x80 and 0xFF are rejected. - For GB2312/EUC-CN, the octets 0x8E, 0x8F, 0xA0 and 0xFF are rejected. For - SJIS, the octets 0x80, 0xA0, 0xFD, 0xFE and 0xFF are rejected, except maybe - after a valid starting byte. For EUC-JP, the octets 0xA0 and 0xFF are - rejected. -- htmlentities now emits an E_STRICT warning when used with asian characters, - as in that case htmlentities has (and already had before this version) the - same functionality as htmlspecialchars. -- htmlentities no longer numerically encodes high characters for single-byte - encodings (except when there's actually a corresponding named entity). This - behavior was not documented and was inconsistent with that for "UTF-8". -- html_entity_decode/htmlspecialchars_decode behave more consistently, now - decoding entities in malformed strings such as "&&" or "&#&". -- htmlentities/htmlspecialchars/html_entity_decode/htmlspecialchars_decode: - Added the flags ENT_HTML401, ENT_XML1, ENT_XHTML, and ENT_HTML5. The - behavior of these functions including, but not limited to, the characters - that are encoded and the entities that are decoded depend on the document - type that is specified by those flags. -- htmlentities/htmlspecialchars with !$double_encode do more strict checks on - the validity of the entities. Numerical entities are checked for a valid - range (0 to 0x10FFFF); if the flag ENT_DISALLOWED is given, the validity of - such numerical entity in the target document type is also checked. Named - entities are checked for necessary existence in the target document type - instead of only checking whether they were constituted by alphanumeric - characters. -- The flag ENT_DISALLOWED was added. In addition to the behavior described in - the item before, it also makes htmlentities/htmlspecialchars substitute - characters that appear literally in the argument string and which are not - allowed in the target document type with U+FFFD (UTF-8) or �. -- The flag ENT_SUBSTITUTE was added. This flag makes invalid multibyte - sequences be replaced by U+FFFD (UTF-8) or &#FFFD; by htmlspecialchars and - htmlentities. It is an alternative to the default behavior, which just - returns an empty string and to ENT_IGNORE, which is a security risk. The - behavior follows the recommendations of Unicode Technical Report #36. -- htmlspecialchars_decode/html_entity_decode now decode ' if the document - type is ENT_XML1, ENT_XHTML, or ENT_HTML5. -- Charset detection with $charset == '' no longer turns to mbstring's - internal encoding defined through mb_internal_encoding(). Only the encoding - defined through the ini setting mbstring.internal_encoding is considered. -- number_format() no longer truncates multibyte decimal points and thousand - separators to the first byte. -- The third parameter ($matches) to preg_match_all() is now optional. If - omitted, the function will simply return the number of times the pattern was - matched in the subject and will have no other side effects. -- The second argument of scandir() now accepts SCANDIR_SORT_NONE (2) as a - possible value. This value results in scandir() performing no sorting: on - local filesystems, this allows files to be returned in native filesystem - order. -- stream_select() now preserves the keys of the passed array, be they numeric or - strings. This breaks code that iterated the resulting stream array using a - numeric index, but makes easier to identify which of the passed streams are - present in the result. -- stream_set_write_buffer() no longer disables the read buffer of a plain - stream when 0 is given as the second argument. -- stream_set_write_buffer() no longer changes the chunk size in socket streams. -- fclose() closes streams with resource refcount > 1; it doesn't merely - decrement the resource refcount. -- socket_set_options() and socket_get_options() now support multicast options. -- Arrays cast from SimpleXMLElement now always contain all nodes instead of - just the first matching node. -- All SimpleXMLElement children are now always printed when using var_dump(), - var_export(), and print_r(). -- Write operations within XSLT (for example with the extension sax:output) are - disabled by default. You can define what is forbidden with the method - XsltProcess::setSecurityPrefs($options) +- =================================== 5. Changes made to existing methods @@ -198,71 +66,33 @@ 6. Changes made to existing classes =================================== -- Classes that implement stream wrappers can define a method called - stream_truncate that will respond to truncation, e.g. through ftruncate. - Strictly speaking, this is an addition to the user-space stream wrapper - template, not a change to an actual class. +- ============= 7. Deprecated ============= +- + ========== 8. Removed ========== a. removed features - - magic quotes - . remove magic_quotes_gpc, magic_quotes_runtime, - magic_quotes_sybase (calling ini_set('magic_....') - returns 0|false - . get_magic_quotes_gpc, get_magic_quotes_runtime are kept but - always return false - . set_magic_quotes_runtime raises an E_CORE_ERROR + - - - register_globals - - register_long_arrays - - Safe mode - - Session extension bug compatibility mode - - y2k_compliance mode - b. removed ini directives - - define_syslog_variables - - register_globals - - register_long_arrays - - safe_mode - - safe_mode_gid - - safe_mode_include_dir - - safe_mode_exec_dir - - safe_mode_allowed_env_vars - - safe_mode_protected_env_vars - - session.bug_compat42 - - session.bug_compat_warn - - y2k_compliance + - c. removed functions - - define_syslog_variables() - - import_request_variables() - - session_is_registered() - - session_register() - - session_unregister() - - mysqli_bind_param() (alias of mysqli_stmt_bind_param()) - - mysqli_bind_result() (alias of mysqli_stmt_bind_result()) - - mysqli_client_encoding() (alias of mysqli_character_set_name()) - - mysqli_fetch() (alias of mysqli_stmt_fetch()) - - mysqli_param_count() (alias of mysqli_stmt_param_count()) - - mysqli_get_metadata() (alias of mysqli_stmt_result_metadata()) - - mysqli_send_long_data() (alias of mysqli_stmt_send_long_data()) - - mysqli::client_encoding() (alias of mysqli::character_set_name) - - mysqli_stmt::stmt() (never worked/always throws, undocumented) + - d. removed syntax - - break $var; - - continue $var; + - ============= 9. Extensions @@ -274,35 +104,11 @@ b. no longer maintained - - ext/sqlite + - c. with changed behaviour - - The session extension now can hook into the file upload feature - in order to provide upload progress information through session - variables. - - SNMP extension - - Functions in SNMP extension now returns FALSE on every error - condition including SNMP-related (no such instance, end of MIB, - etc). Thus, in patricular, breaks previous behaviour of get/walk - functions returning an empty string on SNMP-related errors. - - Multi OID get/getnext/set queries are now supported. - - New constants added for use in snmp_set_oid_output_format() - function. - - Function snmp_set_valueretrieval() changed it's behaviour: - SNMP_VALUE_OBJECT can be combined with one of - SNMP_VALUE_PLAIN or SNMP_VALUE_LIBRARY resulting OID value - changes. When no SNMP_VALUE_PLAIN or SNMP_VALUE_LIBRARY - is supplied with SNMP_VALUE_OBJECT, SNMP_VALUE_LIBRARY is used. - Prior to 5.4.0 when no SNMP_VALUE_PLAIN or SNMP_VALUE_LIBRARY - was supplied with SNMP_VALUE_OBJECT, SNMP_VALUE_PLAIN was used. - - Added feature-rich OO API (SNMP class) - - Dropped UCD-SNMP compatibility code. Consider upgrading to - net-snmp v5.3+. Net-SNMP v5.4+ is required for Windows version. - - In sake of adding support for IPv6 DNS name resolution of - remote SNMP agent (peer) is done by extension now, not by Net-SNMP - library anymore. - + - d. no longer possible to disable @@ -312,44 +118,25 @@ 10. Changes in SAPI support ========================== -- The REQUEST_TIME value inside server now returns a floating point number - indicating the time with microsecond precision. All SAPIs providing this - value should be returning float and not time_t. +- ============================= 11. Changes in INI directives ============================= -- Added session.upload_progress.enabled, session.upload_progress.cleanup, - session.upload_progress.prefix, session.upload_progress.name, - session.upload_progress.freq, session.upload_progress.min_freq. -- Added zend.multibyte directive as a replacement of PHP compile time - configuration option --enable-zend-multibyte. Now ZE always contains code for - multibyte support, but may enable or disable it by zend.multibyte. It doesn't - make a lot of sense to enable this option without ext/mbstring, because the - most functionality is implemented by mbstrings callbacks. -- Added enable_post_data_reading, which is enabled by default. When it's - disabled, the POST data is not read (and processed); the behavior is similar - to that of other request methods with body, like PUT. This allows reading the - raw POST data in multipart requests and read/process the POST data in a - stream fashion (through php://input), without having it copied in memory two/ - three times. +- ==================== 12. Syntax additions ==================== -- Array dereferencing. - e.g. - foo()[0] - $foo->bar()[0] +- =================== 13. Windows support =================== -- is_link now works properly for symbolic links on Windows Vista - or later. Earlier systems do not support symbolic links. +- =================== 14. New in PHP X.Y: @@ -373,101 +160,32 @@ e. New functions - - Core: - - get_declared_traits() - - http_response_code() - - trait_exists() - - stream_set_chunk_size() - - socket_import_stream() + - Extension: + - function() - - libxml - - libxml_set_external_entity_loader() - f. New global constants - - JSON_PRETTY_PRINT - - JSON_UNESCAPED_SLASHES - - ENT_SUBSTITUTE - - ENT_ALLOWED - - ENT_HTML401 - - ENT_XML1 - - ENT_XHTML - - ENT_HTML5 - - SCANDIR_SORT_ASCENDING - - SCANDIR_SORT_DESCENDING - - SCANDIR_SORT_NONE - - MCAST_JOIN_GROUP - - MCAST_LEAVE_GROUP - - MCAST_BLOCK_SOURCE - - MCAST_UNBLOCK_SOURCE - - MCAST_JOIN_SOURCE_GROUP - - MCAST_LEAVE_SOURCE_GROUP - - IP_MULTICAST_IF - - IP_MULTICAST_TTL - - IP_MULTICAST_LOOP - - IPV6_MULTICAST_IF - - IPV6_MULTICAST_HOPS - - IPV6_MULTICAST_LOOP - - IPPROTO_IP - - IPPROTO_IPV6 + - g. New classes - - Reflection: - - ReflectionZendExtension + - Extension: + - ClassName - - Intl: - - Transliterator - - - SNMP: - - SNMP - - - SPL: - - CallbackFilterIterator - - RecursiveCallbackFilterIterator - h. New methods - - DirectoryIterator - - DirectoryIterator::getExtension() - - - Reflection: - - ReflectionClass::isCloneable() - - ReflectionClass::getTraits() - - ReflectionClass::getTraitNames() - - ReflectionClass::getTraitAliases() - - ReflectionParameter::canBePassedByValue() - - - RegexIterator - - RegexIterator::getRegex() - - - PDO_dblib - - PDO::newRowset() - - - SplFileInfo - - SplFileInfo::getExtension() - - - SplFileObject - - SplFileObject::fputcsv() - - - SplFixedArray + - Spl: - SplFixedArray::__wakeup() i. New class constants - - + - Extension: + - ClassName::CONSTANT j. New Hash algorithms - - fnv132 - - fnv164 - - joaat + - k. New Syntax - - Short array syntax in 5.4.0 - $a = [1, 2, 3, 4]; - $a = ['one' => 1, 'two' => 2, 'three' => 3, 'four' => 4]; - $a = ['one' => 1, 2, 'three' => 3, 4]; - - Binary number format - 0b00100 0b010101 + - Modified: php/php-src/trunk/UPGRADING.INTERNALS =================================================================== --- php/php-src/trunk/UPGRADING.INTERNALS 2012-02-22 09:33:01 UTC (rev 323422) +++ php/php-src/trunk/UPGRADING.INTERNALS 2012-02-22 10:08:37 UTC (rev 323423) @@ -3,15 +3,7 @@ UPGRADE NOTES - PHP X.Y 1. Internal API changes - a. virtual_file_ex - b. stat/lstat support - c. readlink support - d. layout of some core ZE structures (zend_op_array, zend_class_entry, ...) - e. Zend\zend_fast_cache.h has been removed - f. streams that enclose private streams - g. leak_variable - h. API Signature changes - i. new TSRM function expand_filepath_with_mode + a. Streams pooling API 2. Build system changes a. Unix build system changes @@ -22,186 +14,25 @@ 1. Internal API changes ======================== - a. virtual_file_ex + a. Streams pooling API -virtual_file_ex takes now a TSRM context as last parameter: -CWD_API int virtual_file_ex(cwd_state *state, const char *path, - verify_path_func verify_path, int use_realpath TSRLS_DC); +The streams pooling API has been removed. The following functions no longer +exist: +PHPAPI int php_stream_context_get_link(php_stream_context *context, + const char *hostent, php_stream **stream); +PHPAPI int php_stream_context_set_link(php_stream_context *context, + const char *hostent, php_stream *stream); +PHPAPI int php_stream_context_del_link(php_stream_context *context, + php_stream *stream); - b. stat/lstat support - -lstat is now available on all platforms. On unix-like platform -php_sys_lstat is an alias to lstat (when avaible). On Windows it is now -available using php_sys_lstat. php_sys_stat and php_sys_lstat usage is recommended -instead of calling lstat directly, to ensure portability. - - - c. readlink support - -readlink is now available on all platforms. On unix-like platform -php_sys_readlink is an alias to readlink (when avaible). On Windows it is now -available using php_sys_readlink. php_sys_readlink usage is recommended -instead of calling readlink directly, to ensure portability. - - - d. layout of some core ZE structures (zend_op_array, zend_class_entry, ...) - -. zend_function.pass_rest_by_reference is replaced by - ZEND_ACC_PASS_REST_BY_REFERENCE in zend_function.fn_flags -. zend_function.return_reference is replaced by ZEND_ACC_RETURN_REFERENCE - in zend_function.fn_flags -. zend_arg_info.required_num_args removed. it was needed only for internal - functions. Now the first arg_info for internal function (which has special - meaning) is represented by zend_internal_function_info structure. -. zend_op_array.size, size_var, size_literal, current_brk_cont, - backpatch_count moved into CG(context), because they are used only during - compilation. -. zend_op_array.start_op is moved into EG(start_op), because it's used - only for 'interactive' execution of single top-level op-array. -. zend_op_array.done_pass_two is replaced by ZEND_ACC_DONE_PASS_TWO in - zend_op_array.fn_flags. -. op_array.vars array is trimmed (reallocated) during pass_two. -. zend_class_entry.constants_updated is replaced by - ZEND_ACC_CONSTANTS_UPDATED in zend_class_entry.ce_flags -. the size of zend_class_entry is reduced by sharing the same memory space - by different information for internal and user classes. - See zend_class_inttry.info union. - - - e. Zend\zend_fast_cache.h - -It should not have been used anymore since php5, but now this header has -been removed. The following macros are not available anymore: - -ZEND_FAST_ALLOC(p, type, fc_type) -ZEND_FAST_FREE(p, fc_type) -ZEND_FAST_ALLOC_REL(p, type, fc_type) -ZEND_FAST_FREE_REL(p, fc_type) - -Use emalloc, emalloc_rel, efree or efree_rel instead. - - - f. Streams that enclose private streams - -Some streams, like the temp:// stream, may enclose private streams. If the -outer stream leaks due to a programming error or is not exposed through a -zval (and therefore is not deleted when all the zvals are gone), it will -be destroyed on shutdown. -The problem is that the outer usually wants itself to close the inner stream, -so that it may do any other shutdown action that requires the inner stream to -be live (e.g. commit data to it). If the outer stream is exposed through a -zval and the inner one isn't, this is not a problem because the outer stream -will be freed when the zval is destroyed, which happens before the resources -are destroyed on shutdown. -On resource list shutdown, the cleanup happens in reverse order of resource -creation, so if the inner stream was created in the opener of the outer stream, -it will be destroyed first. -The following functions were added to the streams API to force a predictable -destruction order: - -PHPAPI php_stream *php_stream_encloses(php_stream *enclosing, php_stream *enclosed); -#define php_stream_free_enclosed(stream_enclosed, close_options) -PHPAPI int _php_stream_free_enclosed(php_stream *stream_enclosed, int close_options TSRMLS_DC); - -Additionally, the following member was added to php_stream: - - struct _php_stream *enclosing_stream; - -and the following macro was added: - -#define PHP_STREAM_FREE_IGNORE_ENCLOSING 32 - -The function php_stream_encloses declares the first stream encloses the second. -This has the effect that, when the inner stream is closed from a resource -destructor it will abort and try to free its enclosing stream instead. -To prevent this from happening when the inner stream is freed from the outer -stream, the macro php_stream_free_enclosed should be used instead of -php_stream_free/php_stream_close/php_stream_pclose, or the flag -PHP_STREAM_FREE_IGNORE_ENCLOSING should be directly passed to php_stream_free. -The outer stream cannot abstain, in its close callback, from closing the inner -stream or clear the enclosing_stream pointer in its enclosed stream by calling -php_stream_encloses with the 2nd argument NULL. If this is not done, there will -be problems, so observe this requirement when using php_stream_encloses. - - - g. leak_variable - -The function leak_variable(variable [, leak_data]) was added. It is only -available on debug builds. It increments the refcount of a zval or, if the -second argument is true and the variable is either an object or a resource -it increments the refcounts of those objects instead. - - - h. API Signature changes - -. zend_list_insert - ZEND_API int zend_list_insert(void *ptr, int type TSRMLS_DC); - call: zend_list_insert(a, SOMETYPE TSRMLS_CC); - NB: If zend_list_insert is used to register a resource, - ZEND_REGISTER_RESOURCE could be used instead. - -. php_le_stream_context(TSRMLS_C) - PHPAPI php_stream_context *php_stream_context_alloc(TSRMLS_D) - call: context = php_stream_context_alloc(TSRMLS_C); - -. php_stream_context_alloc - PHPAPI php_stream_context *php_stream_context_alloc(TSRMLS_D); - call: context = php_stream_context_alloc(TSRMLS_C); - -. sapi_get_request_time(TSRMLS_D); - SAPI_API double sapi_get_request_time(TSRMLS_D); - -. sapi_register_default_post_reader - SAPI_API int sapi_register_default_post_reader(void (*default_post_reader)(TSRMLS_D) TSRMLS_DC); - -. sapi_register_treat_data - SAPI_API int sapi_register_treat_data(void (*treat_data)(int arg, char *str, zval *destArray TSRMLS_DC) TSRMLS_DC); - -. sapi_register_input_filter - SAPI_API int sapi_register_input_filter(unsigned int (*input_filter)(int arg, char *var, char **val, unsigned int val_len, unsigned int *new_val_len TSRMLS_DC), unsigned int (*input_filter_init)(TSRMLS_D) TSRMLS_DC); - -. tsrm_win32_access - TSRM_API int tsrm_win32_access(const char *pathname, int mode TSRMLS_DC); - -. popen_ex (win32) - TSRM_API FILE *popen_ex(const char *command, const char *type, const char *cwd, char *env TSRMLS_DC); - -. php_get_current_user - PHPAPI php_get_current_user(TSRMLS_D) - Call: char *user = php_get_current_user(TSRMLS_C); - -. php_idate - PHPAPI php_idate(char format, time_t ts, int localtime TSRMLS_DC) - Call: int ret = php_idate(format, ts, localtime TSRMLS_CC) - -. php_escape_html_entities - (size_t parameters were ints, previous "quote_style" (now flags) has expanded meaning) - PHPAPI char *php_escape_html_entities(unsigned char *old, size_t oldlen, size_t *newlen, int all, int flags, char *hint_charset TSRMLS_DC); - -. php_escape_html_entities_ex - PHPAPI char *php_escape_html_entities_ex(unsigned char *old, size_t oldlen, size_t *newlen, int all, int flags, char *hint_charset, zend_bool double_encode TSRMLS_DC); - -. php_unescape_html_entities - PHPAPI char *php_unescape_html_entities(unsigned char *old, size_t oldlen, size_t *newlen, int all, int flags, char *hint_charset TSRMLS_DC); - - i. - PHPAPI char *expand_filepath_with_mode(const char *filepath, char *real_path, const char *relative_to, size_t relative_to_len, int realpath_mode TSRMLS_DC); - expand_filepath_with_mode lets define how realpath will behave, using one of the existing mode: CWD_EXPAND , CWD_FILEPATH or CWD_REALPATH. - ======================== 2. Build system changes ======================== a. Unix build system changes + - - - Changes in SAPI module build: - . When adding new binary SAPI (executable, like CLI/CGI/FPM) use CLI config.m4 and Makefile.frag files as templates and replace CLI/cli with your SAPI name. - - - New macros: - . PHP_INIT_DTRACE(providerdesc, header-file, sources [, module]) - - b. Windows build system changes - - + -
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php