dmitry Wed, 24 Nov 2010 05:41:23 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=305711
Log: Added multibyte suppport by default. Previosly php had to be compiled with --enable-zend-multibyte. Now it can be enabled or disabled throug zend.multibyte directive in php.ini Changed paths: U php/php-src/trunk/NEWS U php/php-src/trunk/UPGRADING U php/php-src/trunk/Zend/Zend.m4 U php/php-src/trunk/Zend/tests/declare_001.phpt A php/php-src/trunk/Zend/tests/declare_002.phpt U php/php-src/trunk/Zend/tests/multibyte/multibyte_encoding_001.phpt U php/php-src/trunk/Zend/tests/multibyte/multibyte_encoding_002.phpt U php/php-src/trunk/Zend/tests/multibyte/multibyte_encoding_003.phpt U php/php-src/trunk/Zend/tests/multibyte/multibyte_encoding_004.phpt U php/php-src/trunk/Zend/tests/multibyte/multibyte_encoding_005.phpt U php/php-src/trunk/Zend/tests/multibyte/multibyte_encoding_006.phpt U php/php-src/trunk/Zend/zend.c U php/php-src/trunk/Zend/zend_compile.c U php/php-src/trunk/Zend/zend_globals.h U php/php-src/trunk/Zend/zend_highlight.c U php/php-src/trunk/Zend/zend_language_scanner.h U php/php-src/trunk/Zend/zend_language_scanner.l U php/php-src/trunk/Zend/zend_multibyte.c U php/php-src/trunk/Zend/zend_multibyte.h U php/php-src/trunk/ext/mbstring/mbstring.c U php/php-src/trunk/ext/mbstring/mbstring.h U php/php-src/trunk/ext/mbstring/tests/zend_multibyte-10.phpt U php/php-src/trunk/ext/mbstring/tests/zend_multibyte-11.phpt U php/php-src/trunk/ext/phar/tests/zip/notphar.phpt U php/php-src/trunk/ext/standard/info.c U php/php-src/trunk/main/main.c U php/php-src/trunk/win32/build/config.w32
Modified: php/php-src/trunk/NEWS =================================================================== --- php/php-src/trunk/NEWS 2010-11-24 05:16:40 UTC (rev 305710) +++ php/php-src/trunk/NEWS 2010-11-24 05:41:23 UTC (rev 305711) @@ -28,6 +28,9 @@ - Changed third parameter of preg_match_all() to optional. FR #53238. (Adam) - General improvements: + . Added multibyte suppport by default. Previosly php had to be compiled + with --enable-zend-multibyte. Now it can be enabled or disabled throug + zend.multibyte directive in php.ini (Dmitry) . Added scalar typehints to the parser and the reflection API. (Ilia, Derick) . Added support for Traits. (Stefan) . Added closure $this support back. (Stas) Modified: php/php-src/trunk/UPGRADING =================================================================== --- php/php-src/trunk/UPGRADING 2010-11-24 05:16:40 UTC (rev 305710) +++ php/php-src/trunk/UPGRADING 2010-11-24 05:41:23 UTC (rev 305711) @@ -235,6 +235,11 @@ - 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. ==================== 11. Syntax additions Modified: php/php-src/trunk/Zend/Zend.m4 =================================================================== --- php/php-src/trunk/Zend/Zend.m4 2010-11-24 05:16:40 UTC (rev 305710) +++ php/php-src/trunk/Zend/Zend.m4 2010-11-24 05:41:23 UTC (rev 305711) @@ -176,13 +176,6 @@ ZEND_INLINE_OPTIMIZATION=yes ]) -AC_ARG_ENABLE(zend-multibyte, -[ --enable-zend-multibyte Compile with zend multibyte support], [ - ZEND_MULTIBYTE=$enableval -],[ - ZEND_MULTIBYTE=no -]) - AC_MSG_CHECKING([virtual machine dispatch method]) AC_MSG_RESULT($PHP_ZEND_VM) @@ -195,9 +188,6 @@ AC_MSG_CHECKING(whether to enable Zend debugging) AC_MSG_RESULT($ZEND_DEBUG) -AC_MSG_CHECKING(whether to enable Zend multibyte) -AC_MSG_RESULT($ZEND_MULTIBYTE) - case $PHP_ZEND_VM in SWITCH) AC_DEFINE(ZEND_VM_KIND,ZEND_VM_KIND_SWITCH,[virtual machine dispatch method]) @@ -232,10 +222,6 @@ LIBZEND_CPLUSPLUS_CHECKS fi -if test "$ZEND_MULTIBYTE" = "yes"; then - AC_DEFINE(ZEND_MULTIBYTE, 1, [ ]) -fi - changequote({,}) if test -n "$GCC" && test "$ZEND_INLINE_OPTIMIZATION" != "yes"; then INLINE_CFLAGS=`echo $ac_n "$CFLAGS $ac_c" | sed s/-O[0-9s]*//` Modified: php/php-src/trunk/Zend/tests/declare_001.phpt =================================================================== --- php/php-src/trunk/Zend/tests/declare_001.phpt 2010-11-24 05:16:40 UTC (rev 305710) +++ php/php-src/trunk/Zend/tests/declare_001.phpt 2010-11-24 05:41:23 UTC (rev 305711) @@ -2,8 +2,8 @@ Testing declare statement with several type values --SKIPIF-- <?php -if (in_array("detect_unicode", array_keys(ini_get_all()))) { - die("skip"); +if (ini_get("zend.multibyte")) { + die("skip Requires zend.multibyte=0"); } ?> --FILE-- Added: php/php-src/trunk/Zend/tests/declare_002.phpt =================================================================== --- php/php-src/trunk/Zend/tests/declare_002.phpt (rev 0) +++ php/php-src/trunk/Zend/tests/declare_002.phpt 2010-11-24 05:41:23 UTC (rev 305711) @@ -0,0 +1,28 @@ +--TEST-- +Testing declare statement with several type values +--SKIPIF-- +<?php +if (!ini_get("zend.multibyte")) { + die("skip Requires zend.multibyte=1"); +} +?> +--FILE-- +<?php + +declare(encoding = 1); +declare(encoding = 1123131232131312321); +declare(encoding = NULL); +declare(encoding = 'utf-8'); +declare(encoding = M_PI); + +print 'DONE'; + +?> +--EXPECTF-- +Warning: Unsupported encoding [%d] in %sdeclare_002.php on line 3 + +Warning: Unsupported encoding [%f] in %sdeclare_002.php on line 4 + +Warning: Unsupported encoding [] in %sdeclare_002.php on line 5 + +Fatal error: Cannot use constants as encoding in %sdeclare_002.php on line 7 Modified: php/php-src/trunk/Zend/tests/multibyte/multibyte_encoding_001.phpt =================================================================== --- php/php-src/trunk/Zend/tests/multibyte/multibyte_encoding_001.phpt 2010-11-24 05:16:40 UTC (rev 305710) +++ php/php-src/trunk/Zend/tests/multibyte/multibyte_encoding_001.phpt 2010-11-24 05:41:23 UTC (rev 305711) @@ -10,6 +10,7 @@ } ?> --INI-- +zend.multibyte=1 mbstring.internal_encoding=SJIS --FILE-- <?php Modified: php/php-src/trunk/Zend/tests/multibyte/multibyte_encoding_002.phpt =================================================================== --- php/php-src/trunk/Zend/tests/multibyte/multibyte_encoding_002.phpt 2010-11-24 05:16:40 UTC (rev 305710) +++ php/php-src/trunk/Zend/tests/multibyte/multibyte_encoding_002.phpt 2010-11-24 05:41:23 UTC (rev 305711) @@ -10,6 +10,7 @@ } ?> --INI-- +zend.multibyte=1 mbstring.internal_encoding=iso-8859-1 --FILE-- <?php Modified: php/php-src/trunk/Zend/tests/multibyte/multibyte_encoding_003.phpt =================================================================== --- php/php-src/trunk/Zend/tests/multibyte/multibyte_encoding_003.phpt 2010-11-24 05:16:40 UTC (rev 305710) +++ php/php-src/trunk/Zend/tests/multibyte/multibyte_encoding_003.phpt 2010-11-24 05:41:23 UTC (rev 305711) @@ -10,6 +10,7 @@ } ?> --INI-- +zend.multibyte=1 mbstring.internal_encoding=iso-8859-1 --FILE-- ÿþ<