summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@php.net>2010-07-08 07:40:02 +0000
committerDmitry Stogov <dmitry@php.net>2010-07-08 07:40:02 +0000
commiteea8fc6122d80179adbfd9f0a234d9cb23c7984e (patch)
tree90e310f504aa7eb7d547ad1c213ddd82e5a4de18
parentdf8bf2a2de49b62265abdb412a9d96a41498884a (diff)
downloadphp-git-eea8fc6122d80179adbfd9f0a234d9cb23c7984e.tar.gz
Reduced overhead of request startup
-rw-r--r--ext/mbstring/mb_gpc.c2
-rw-r--r--ext/mbstring/mbstring.c5
-rw-r--r--ext/mbstring/mbstring.h1
3 files changed, 6 insertions, 2 deletions
diff --git a/ext/mbstring/mb_gpc.c b/ext/mbstring/mb_gpc.c
index 501adad6b4..acfde4d5ae 100644
--- a/ext/mbstring/mb_gpc.c
+++ b/ext/mbstring/mb_gpc.c
@@ -60,7 +60,7 @@ MBSTRING_API SAPI_TREAT_DATA_FUNC(mbstr_treat_data)
php_mb_encoding_handler_info_t info;
if (arg != PARSE_STRING) {
- char *value = zend_ini_string("mbstring.internal_encoding", sizeof("mbstring.internal_encoding"), 0);
+ char *value = MBSTRG(internal_encoding_name);
_php_mb_ini_mbstring_internal_encoding_set(value, value ? strlen(value): 0 TSRMLS_CC);
}
diff --git a/ext/mbstring/mbstring.c b/ext/mbstring/mbstring.c
index 97eaf66eb3..4ca4545e97 100644
--- a/ext/mbstring/mbstring.c
+++ b/ext/mbstring/mbstring.c
@@ -1108,6 +1108,9 @@ int _php_mb_ini_mbstring_internal_encoding_set(const char *new_value, uint new_v
/* {{{ static PHP_INI_MH(OnUpdate_mbstring_internal_encoding) */
static PHP_INI_MH(OnUpdate_mbstring_internal_encoding)
{
+ if (OnUpdateString(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC) == FAILURE) {
+ return FAILURE;
+ }
if (stage == PHP_INI_STAGE_STARTUP || stage == PHP_INI_STAGE_SHUTDOWN
|| stage == PHP_INI_STAGE_RUNTIME) {
return _php_mb_ini_mbstring_internal_encoding_set(new_value, new_value_length TSRMLS_CC);
@@ -1245,7 +1248,7 @@ PHP_INI_BEGIN()
PHP_INI_ENTRY("mbstring.detect_order", NULL, PHP_INI_ALL, OnUpdate_mbstring_detect_order)
PHP_INI_ENTRY("mbstring.http_input", "pass", PHP_INI_ALL, OnUpdate_mbstring_http_input)
PHP_INI_ENTRY("mbstring.http_output", "pass", PHP_INI_ALL, OnUpdate_mbstring_http_output)
- PHP_INI_ENTRY("mbstring.internal_encoding", NULL, PHP_INI_ALL, OnUpdate_mbstring_internal_encoding)
+ STD_PHP_INI_ENTRY("mbstring.internal_encoding", NULL, PHP_INI_ALL, OnUpdate_mbstring_internal_encoding, internal_encoding_name, zend_mbstring_globals, mbstring_globals)
#ifdef ZEND_MULTIBYTE
PHP_INI_ENTRY("mbstring.script_encoding", NULL, PHP_INI_ALL, OnUpdate_mbstring_script_encoding)
#endif /* ZEND_MULTIBYTE */
diff --git a/ext/mbstring/mbstring.h b/ext/mbstring/mbstring.h
index befd6ce032..8e9a5806e1 100644
--- a/ext/mbstring/mbstring.h
+++ b/ext/mbstring/mbstring.h
@@ -163,6 +163,7 @@ MBSTRING_API int php_mb_stripos(int mode, const char *old_haystack, unsigned int
int _php_mb_ini_mbstring_internal_encoding_set(const char *new_value, uint new_value_length TSRMLS_DC);
ZEND_BEGIN_MODULE_GLOBALS(mbstring)
+ char *internal_encoding_name;
enum mbfl_no_language language;
enum mbfl_no_encoding internal_encoding;
enum mbfl_no_encoding current_internal_encoding;