]> granicus.if.org Git - php/commitdiff
Fixed bug #39344 (Unnecessary calls to OnModify callback routine for an extension...
authorDmitry Stogov <dmitry@php.net>
Wed, 8 Nov 2006 11:04:27 +0000 (11:04 +0000)
committerDmitry Stogov <dmitry@php.net>
Wed, 8 Nov 2006 11:04:27 +0000 (11:04 +0000)
NEWS
Zend/zend.c
Zend/zend_ini.c

diff --git a/NEWS b/NEWS
index 05975973efaec6b091d7243423a9edda21c59b2c..2481c6b351735199e8f01e33a45b21f4b82a9117 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -26,6 +26,8 @@ PHP                                                                        NEWS
   (Ilia)
 - Fixed bug #39354 (Allow building of curl extension against libcurl 7.16.0)
   (Ilia) 
+- Fixed bug #39344 (Unnecessary calls to OnModify callback routine for
+  an extension INI directive). (wharmby at uk dot ibm dot com, Dmitry)
 - Fixed bug #39320 (ZEND_HASH_APPLY_STOP causes deletion). (Marcus)
 - Fixed bug #39313 (spl_autoload triggers Fatal error). (Marcus)
 - Fixed bug #39265 (Fixed path handling inside mod_files.sh). 
index 9b1f6e3fb439d8c84bfd2fe39981efc9a34e492f..ee8b4b767f027962c12760976701e84170394f7e 100644 (file)
@@ -522,8 +522,9 @@ static void executor_globals_dtor(zend_executor_globals *executor_globals TSRMLS
 
 static void zend_new_thread_end_handler(THREAD_T thread_id TSRMLS_DC)
 {
-       zend_copy_ini_directives(TSRMLS_C);
-       zend_ini_refresh_caches(ZEND_INI_STAGE_STARTUP TSRMLS_CC);
+       if (zend_copy_ini_directives(TSRMLS_C) == SUCCESS) {
+               zend_ini_refresh_caches(ZEND_INI_STAGE_STARTUP TSRMLS_CC);
+       }
 }
 #endif
 
@@ -700,7 +701,7 @@ void zend_post_startup(TSRMLS_D)
        free(EG(zend_constants));
        executor_globals_ctor(executor_globals, tsrm_ls);
        global_persistent_list = &EG(persistent_list);
-       zend_new_thread_end_handler(tsrm_thread_id() TSRMLS_CC);
+       zend_copy_ini_directives(TSRMLS_C);
 }
 #endif
 
index 1cade26d6a49bf16cb3873424f5d22049f38dd38..c4951acee90b968f467ba9593e88816f426739ab 100644 (file)
@@ -126,7 +126,6 @@ ZEND_API int zend_copy_ini_directives(TSRMLS_D)
                return FAILURE;
        }
        zend_hash_copy(EG(ini_directives), registered_zend_ini_directives, NULL, &ini_entry, sizeof(zend_ini_entry));
-       zend_ini_refresh_caches(ZEND_INI_STAGE_STARTUP TSRMLS_CC);
        return SUCCESS;
 }
 #endif
@@ -214,6 +213,7 @@ ZEND_API void zend_unregister_ini_entries(int module_number TSRMLS_DC)
 }
 
 
+#ifdef ZTS
 static int zend_ini_refresh_cache(zend_ini_entry *p, int stage TSRMLS_DC)
 {
        if (p->on_modify) {
@@ -227,6 +227,7 @@ ZEND_API void zend_ini_refresh_caches(int stage TSRMLS_DC)
 {
        zend_hash_apply_with_argument(EG(ini_directives), (apply_func_arg_t) zend_ini_refresh_cache, (void *)(long) stage TSRMLS_CC);
 }
+#endif
 
 
 ZEND_API int zend_alter_ini_entry(char *name, uint name_length, char *new_value, uint new_value_length, int modify_type, int stage)