diff options
author | Dmitry Stogov <dmitry@zend.com> | 2018-12-19 02:49:56 +0300 |
---|---|---|
committer | Dmitry Stogov <dmitry@zend.com> | 2018-12-19 02:49:56 +0300 |
commit | cec091176cecd3f1efd553f4283fa7346184ad36 (patch) | |
tree | 965bd52566d4f58045f8cb7f4ec32097799ef676 /Zend/zend_ini.c | |
parent | f67f42122adb83b6df75ad9f7a64281a73e845f6 (diff) | |
download | php-git-cec091176cecd3f1efd553f4283fa7346184ad36.tar.gz |
Replace zend_hash_apply... with ZEND_HASH_FOREACH...
Diffstat (limited to 'Zend/zend_ini.c')
-rw-r--r-- | Zend/zend_ini.c | 34 |
1 files changed, 12 insertions, 22 deletions
diff --git a/Zend/zend_ini.c b/Zend/zend_ini.c index 6ae963f3b7..07af7b223c 100644 --- a/Zend/zend_ini.c +++ b/Zend/zend_ini.c @@ -71,14 +71,6 @@ static int zend_restore_ini_entry_cb(zend_ini_entry *ini_entry, int stage) /* {{ } /* }}} */ -static int zend_restore_ini_entry_wrapper(zval *el) /* {{{ */ -{ - zend_ini_entry *ini_entry = (zend_ini_entry *)Z_PTR_P(el); - zend_restore_ini_entry_cb(ini_entry, ZEND_INI_STAGE_DEACTIVATE); - return 1; -} -/* }}} */ - static void free_ini_entry(zval *zv) /* {{{ */ { zend_ini_entry *entry = (zend_ini_entry*)Z_PTR_P(zv); @@ -134,7 +126,11 @@ ZEND_API int zend_ini_global_shutdown(void) /* {{{ */ ZEND_API int zend_ini_deactivate(void) /* {{{ */ { if (EG(modified_ini_directives)) { - zend_hash_apply(EG(modified_ini_directives), zend_restore_ini_entry_wrapper); + zend_ini_entry *ini_entry; + + ZEND_HASH_FOREACH_PTR(EG(modified_ini_directives), ini_entry) { + zend_restore_ini_entry_cb(ini_entry, ZEND_INI_STAGE_DEACTIVATE); + } ZEND_HASH_FOREACH_END(); zend_hash_destroy(EG(modified_ini_directives)); FREE_HASHTABLE(EG(modified_ini_directives)); EG(modified_ini_directives) = NULL; @@ -277,21 +273,15 @@ ZEND_API void zend_unregister_ini_entries(int module_number) /* {{{ */ /* }}} */ #ifdef ZTS -static int zend_ini_refresh_cache(zval *el, void *arg) /* {{{ */ -{ - zend_ini_entry *p = (zend_ini_entry *)Z_PTR_P(el); - int stage = (int)(zend_intptr_t)arg; - - if (p->on_modify) { - p->on_modify(p, p->value, p->mh_arg1, p->mh_arg2, p->mh_arg3, stage); - } - return 0; -} -/* }}} */ - ZEND_API void zend_ini_refresh_caches(int stage) /* {{{ */ { - zend_hash_apply_with_argument(EG(ini_directives), zend_ini_refresh_cache, (void *)(zend_intptr_t) stage); + zend_ini_entry *p; + + ZEND_HASH_FOREACH_PTR(EG(ini_directives), p) { + if (p->on_modify) { + p->on_modify(p, p->value, p->mh_arg1, p->mh_arg2, p->mh_arg3, stage); + } + } ZEND_HASH_FOREACH_END(); } /* }}} */ #endif |