]> 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:42 +0000 (11:04 +0000)
committerDmitry Stogov <dmitry@php.net>
Wed, 8 Nov 2006 11:04:42 +0000 (11:04 +0000)
Zend/zend.c
Zend/zend_ini.c

index f5c66a18da8a00eb30c499e583dc7b5127145087..fe0446de3a99bc0407f1670df2bb11b5a8d5f518 100644 (file)
@@ -900,8 +900,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
 
@@ -1178,7 +1179,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 d3a9c5ed766711cde04db739e4e429335d9851c3..d46cd9db46177a6f11425f274b34eaaf8b664dbd 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
@@ -215,6 +214,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) {
@@ -228,6 +228,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)