com php-src: ini intl.explicit_cleanup -> INTL_EXPL ICIT_CLEANUP: ext/intl/php_intl.c
| From: | Gustavo André dos Santos Lopes | Date: | Tue, 24 Jul 2012 13:13:02 +0000 |
| Subject: | com php-src: ini intl.explicit_cleanup -> INTL_EXPL ICIT_CLEANUP: ext/intl/php_intl.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-69683@lists.php.net to get a copy of this message | ||
Commit: f356be68c244dd0dd70894ac4a5c9b4e3a882e04
Author: Gustavo André dos Santos Lopes <cataphract@php.net> Tue, 24 Jul 2012
15:13:02 +0200
Parents: 777160f7b544971f7e73932482735af69bc42ec7
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=f356be68c244dd0dd70894ac4a5c9b4e3a882e04
Log:
ini intl.explicit_cleanup -> INTL_EXPLICIT_CLEANUP
Added an environment variable and removed the ini setting
intl.explicit_cleanup for calling u_cleanup()
Changed paths:
M ext/intl/php_intl.c
Diff:
diff --git a/ext/intl/php_intl.c b/ext/intl/php_intl.c
index 38175ca..78da0f5 100755
--- a/ext/intl/php_intl.c
+++ b/ext/intl/php_intl.c
@@ -853,36 +853,11 @@ zend_function_entry intl_functions[] = {
};
/* }}} */
-static zend_bool explicit_cleanup = 0;
-
-static ZEND_INI_MH(OnExplicitCleanupUpdate)
-{
- if (stage == PHP_INI_STAGE_STARTUP) {
- if (new_value_length == 2 && strcasecmp("on", new_value) == 0) {
- explicit_cleanup = (zend_bool)1;
- }
- else if (new_value_length == 3 && strcasecmp("yes", new_value) == 0) {
- explicit_cleanup = (zend_bool)1;
- }
- else if (new_value_length == 4 && strcasecmp("true", new_value) == 0) {
- explicit_cleanup = (zend_bool)1;
- }
- else {
- explicit_cleanup = (zend_bool)atoi(new_value);
- }
- return SUCCESS;
- } else {
- return FAILURE;
- }
-}
-
-
/* {{{ INI Settings */
PHP_INI_BEGIN()
STD_PHP_INI_ENTRY(LOCALE_INI_NAME, NULL, PHP_INI_ALL, OnUpdateStringUnempty, default_locale,
zend_intl_globals, intl_globals)
STD_PHP_INI_ENTRY("intl.error_level", "0", PHP_INI_ALL, OnUpdateLong,
error_level, zend_intl_globals, intl_globals)
STD_PHP_INI_ENTRY("intl.use_exceptions", "0", PHP_INI_ALL, OnUpdateBool,
use_exceptions, zend_intl_globals, intl_globals)
- PHP_INI_ENTRY_EX("intl.explicit_cleanup", "0", 0, OnExplicitCleanupUpdate,
zend_ini_boolean_displayer_cb)
PHP_INI_END()
/* }}} */
@@ -1015,14 +990,18 @@ PHP_MINIT_FUNCTION( intl )
}
/* }}} */
+#define EXPLICIT_CLEANUP_ENV_VAR "INTL_EXPLICIT_CLEANUP"
+
/* {{{ PHP_MSHUTDOWN_FUNCTION
*/
PHP_MSHUTDOWN_FUNCTION( intl )
{
+ const char *cleanup;
/* For the default locale php.ini setting */
UNREGISTER_INI_ENTRIES();
- if (explicit_cleanup) {
+ cleanup = getenv(EXPLICIT_CLEANUP_ENV_VAR);
+ if (cleanup != NULL && !(cleanup[0] == '0' && cleanup[1] ==
'\0')) {
u_cleanup();
}