summaryrefslogtreecommitdiff
path: root/Zend/zend.c
diff options
context:
space:
mode:
authorMoriyoshi Koizumi <moriyoshi@php.net>2010-12-19 16:36:37 +0000
committerMoriyoshi Koizumi <moriyoshi@php.net>2010-12-19 16:36:37 +0000
commitbbf3d43c1ee0ad53b03c3821cd630f0746d5e954 (patch)
treefd11ea79a69ee445ffde8310a3760603bf3df821 /Zend/zend.c
parentc28cac404d2d0590ba2811f41331c60d09adbf1e (diff)
downloadphp-git-bbf3d43c1ee0ad53b03c3821cd630f0746d5e954.tar.gz
* Refactor zend_multibyte facility.
Now mbstring.script_encoding is superseded by zend.script_encoding.
Diffstat (limited to 'Zend/zend.c')
-rw-r--r--Zend/zend.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/Zend/zend.c b/Zend/zend.c
index d091593ec4..849a7edf2f 100644
--- a/Zend/zend.c
+++ b/Zend/zend.c
@@ -89,11 +89,25 @@ static ZEND_INI_MH(OnUpdateGCEnabled) /* {{{ */
}
/* }}} */
+static ZEND_INI_MH(OnUpdateScriptEncoding) /* {{{ */
+{
+ if (!CG(multibyte)) {
+ return FAILURE;
+ }
+ if (!zend_multibyte_get_functions(TSRMLS_C)) {
+ return SUCCESS;
+ }
+ return zend_multibyte_set_script_encoding_by_string(new_value, new_value_length TSRMLS_CC);
+}
+/* }}} */
+
+
ZEND_INI_BEGIN()
ZEND_INI_ENTRY("error_reporting", NULL, ZEND_INI_ALL, OnUpdateErrorReporting)
STD_ZEND_INI_BOOLEAN("zend.enable_gc", "1", ZEND_INI_ALL, OnUpdateGCEnabled, gc_enabled, zend_gc_globals, gc_globals)
STD_ZEND_INI_BOOLEAN("zend.multibyte", "0", ZEND_INI_PERDIR, OnUpdateBool, multibyte, zend_compiler_globals, compiler_globals)
- STD_ZEND_INI_BOOLEAN("detect_unicode", "1", ZEND_INI_ALL, OnUpdateBool, detect_unicode, zend_compiler_globals, compiler_globals)
+ ZEND_INI_ENTRY("zend.script_encoding", NULL, ZEND_INI_ALL, OnUpdateScriptEncoding)
+ STD_ZEND_INI_BOOLEAN("zend.detect_unicode", "1", ZEND_INI_ALL, OnUpdateBool, detect_unicode, zend_compiler_globals, compiler_globals)
ZEND_INI_END()
@@ -528,6 +542,9 @@ static void compiler_globals_dtor(zend_compiler_globals *compiler_globals TSRMLS
if (compiler_globals->static_members_table) {
free(compiler_globals->static_members_table);
}
+ if (compiler_globals->script_encoding_list) {
+ pefree(compiler_globals->script_encoding_list, 1);
+ }
compiler_globals->last_static_member = 0;
}
/* }}} */