diff options
author | Zeev Suraski <zeev@php.net> | 2001-01-07 18:39:11 +0000 |
---|---|---|
committer | Zeev Suraski <zeev@php.net> | 2001-01-07 18:39:11 +0000 |
commit | 903018ef368754bace78ab341cb2eb5e6628bcf1 (patch) | |
tree | 3884adafa0f7b560891e5bffecae0ed134b6f922 | |
parent | 7235542ceea62856d6cfd1adab9d90e271b08cd5 (diff) | |
download | php-git-903018ef368754bace78ab341cb2eb5e6628bcf1.tar.gz |
- Remove backward dependency from PHP -> Zend
- Rename get_ini_entry() as get_configuration_directive() for clarity
(it doesn't use the INI subsystem, but the module-supplied function for
retrieving configuration directives)
-rw-r--r-- | Zend/zend.c | 10 | ||||
-rw-r--r-- | Zend/zend.h | 4 | ||||
-rw-r--r-- | Zend/zend_alloc.c | 2 | ||||
-rw-r--r-- | Zend/zend_ini.c | 10 | ||||
-rw-r--r-- | Zend/zend_ini.h | 3 |
5 files changed, 13 insertions, 16 deletions
diff --git a/Zend/zend.c b/Zend/zend.c index b94d2ccf64..8fbb1f5f1d 100644 --- a/Zend/zend.c +++ b/Zend/zend.c @@ -52,7 +52,7 @@ ZEND_API void (*zend_ticks_function)(int ticks); ZEND_API void (*zend_error_cb)(int type, const char *error_filename, const uint error_lineno, const char *format, va_list args); static void (*zend_message_dispatcher_p)(long message, void *data); -static int (*zend_get_ini_entry_p)(char *name, uint name_length, zval *contents); +static int (*zend_get_configuration_directive_p)(char *name, uint name_length, zval *contents); #ifdef ZTS @@ -365,7 +365,7 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions, i zend_message_dispatcher_p = utility_functions->message_handler; zend_block_interruptions = utility_functions->block_interruptions; zend_unblock_interruptions = utility_functions->unblock_interruptions; - zend_get_ini_entry_p = utility_functions->get_ini_entry; + zend_get_configuration_directive_p = utility_functions->get_configuration_directive; zend_ticks_function = utility_functions->ticks_function; zend_compile_file = compile_file; @@ -554,10 +554,10 @@ ZEND_API void zend_message_dispatcher(long message, void *data) END_EXTERN_C() -ZEND_API int zend_get_ini_entry(char *name, uint name_length, zval *contents) +ZEND_API int zend_get_configuration_directive(char *name, uint name_length, zval *contents) { - if (zend_get_ini_entry_p) { - return zend_get_ini_entry_p(name, name_length, contents); + if (zend_get_configuration_directive_p) { + return zend_get_configuration_directive_p(name, name_length, contents); } else { return FAILURE; } diff --git a/Zend/zend.h b/Zend/zend.h index 43b0ef2eb4..f9017bf561 100644 --- a/Zend/zend.h +++ b/Zend/zend.h @@ -234,7 +234,7 @@ typedef struct _zend_utility_functions { void (*message_handler)(long message, void *data); void (*block_interruptions)(void); void (*unblock_interruptions)(void); - int (*get_ini_entry)(char *name, uint name_length, zval *contents); + int (*get_configuration_directive)(char *name, uint name_length, zval *contents); void (*ticks_function)(int ticks); } zend_utility_functions; @@ -356,7 +356,7 @@ BEGIN_EXTERN_C() ZEND_API void zend_message_dispatcher(long message, void *data); END_EXTERN_C() -ZEND_API int zend_get_ini_entry(char *name, uint name_length, zval *contents); +ZEND_API int zend_get_configuration_directive(char *name, uint name_length, zval *contents); /* Messages for applications of Zend */ diff --git a/Zend/zend_alloc.c b/Zend/zend_alloc.c index 1741ce211c..aeca8546fc 100644 --- a/Zend/zend_alloc.c +++ b/Zend/zend_alloc.c @@ -502,7 +502,7 @@ ZEND_API void shutdown_memory_manager(int silent, int clean_cache) /* we're shutting down completely, don't even touch the INI subsystem */ break; } - if (zend_get_ini_entry("display_memory_cache_stats", sizeof("display_memory_cache_stats"), &display_memory_cache_stats)==FAILURE) { + if (zend_get_configuration_directive("display_memory_cache_stats", sizeof("display_memory_cache_stats"), &display_memory_cache_stats)==FAILURE) { break; } if (!atoi(display_memory_cache_stats.value.str.val)) { diff --git a/Zend/zend_ini.c b/Zend/zend_ini.c index 06fc41d45f..62820d9698 100644 --- a/Zend/zend_ini.c +++ b/Zend/zend_ini.c @@ -130,7 +130,7 @@ ZEND_API int zend_register_ini_entries(zend_ini_entry *ini_entry, int module_num { zend_ini_entry *p = ini_entry; zend_ini_entry *hashed_ini_entry; - zval *default_value; + zval default_value; while (p->name) { p->module_number = module_number; @@ -138,11 +138,11 @@ ZEND_API int zend_register_ini_entries(zend_ini_entry *ini_entry, int module_num zend_unregister_ini_entries(module_number); return FAILURE; } - if ((default_value=cfg_get_entry(p->name, p->name_length))) { + if ((zend_get_configuration_directive(p->name, p->name_length, &default_value))) { if (!hashed_ini_entry->on_modify - || hashed_ini_entry->on_modify(hashed_ini_entry, default_value->value.str.val, default_value->value.str.len, hashed_ini_entry->mh_arg1, hashed_ini_entry->mh_arg2, hashed_ini_entry->mh_arg3, ZEND_INI_STAGE_STARTUP)==SUCCESS) { - hashed_ini_entry->value = default_value->value.str.val; - hashed_ini_entry->value_length = default_value->value.str.len; + || hashed_ini_entry->on_modify(hashed_ini_entry, default_value.value.str.val, default_value.value.str.len, hashed_ini_entry->mh_arg1, hashed_ini_entry->mh_arg2, hashed_ini_entry->mh_arg3, ZEND_INI_STAGE_STARTUP)==SUCCESS) { + hashed_ini_entry->value = default_value.value.str.val; + hashed_ini_entry->value_length = default_value.value.str.len; } } else { if (hashed_ini_entry->on_modify) { diff --git a/Zend/zend_ini.h b/Zend/zend_ini.h index 55008a59a6..1dd5904a39 100644 --- a/Zend/zend_ini.h +++ b/Zend/zend_ini.h @@ -139,9 +139,6 @@ ZEND_API ZEND_INI_DISP(display_link_numbers); #define REGISTER_INI_DISPLAYER(name, displayer) zend_ini_register_displayer((name), sizeof(name), displayer) #define REGISTER_INI_BOOLEAN(name) REGISTER_INI_DISPLAYER(name, zend_ini_boolean_displayer_cb) -zval *cfg_get_entry(char *name, uint name_length); - - /* Standard message handlers */ ZEND_API ZEND_INI_MH(OnUpdateBool); ZEND_API ZEND_INI_MH(OnUpdateInt); |