diff options
Diffstat (limited to 'main/php_ini.c')
-rw-r--r-- | main/php_ini.c | 67 |
1 files changed, 33 insertions, 34 deletions
diff --git a/main/php_ini.c b/main/php_ini.c index 5303bf77ec..93b55ded33 100644 --- a/main/php_ini.c +++ b/main/php_ini.c @@ -74,7 +74,7 @@ PHPAPI char *php_ini_scanned_files=NULL; /* {{{ php_ini_displayer_cb */ -static void php_ini_displayer_cb(zend_ini_entry *ini_entry, int type TSRMLS_DC) +static void php_ini_displayer_cb(zend_ini_entry *ini_entry, int type) { if (ini_entry->displayer) { ini_entry->displayer(ini_entry, type); @@ -112,7 +112,7 @@ static void php_ini_displayer_cb(zend_ini_entry *ini_entry, int type TSRMLS_DC) } if (esc_html) { - php_html_puts(display_string, display_string_length TSRMLS_CC); + php_html_puts(display_string, display_string_length); } else { PHPWRITE(display_string, display_string_length); } @@ -122,7 +122,7 @@ static void php_ini_displayer_cb(zend_ini_entry *ini_entry, int type TSRMLS_DC) /* {{{ php_ini_displayer */ -static int php_ini_displayer(zval *el, void *arg TSRMLS_DC) +static int php_ini_displayer(zval *el, void *arg) { zend_ini_entry *ini_entry = (zend_ini_entry*)Z_PTR_P(el); int module_number = *(int *)arg; @@ -135,16 +135,16 @@ static int php_ini_displayer(zval *el, void *arg TSRMLS_DC) PUTS("<td class=\"e\">"); PHPWRITE(ini_entry->name->val, ini_entry->name->len); PUTS("</td><td class=\"v\">"); - php_ini_displayer_cb(ini_entry, ZEND_INI_DISPLAY_ACTIVE TSRMLS_CC); + php_ini_displayer_cb(ini_entry, ZEND_INI_DISPLAY_ACTIVE); PUTS("</td><td class=\"v\">"); - php_ini_displayer_cb(ini_entry, ZEND_INI_DISPLAY_ORIG TSRMLS_CC); + php_ini_displayer_cb(ini_entry, ZEND_INI_DISPLAY_ORIG); PUTS("</td></tr>\n"); } else { PHPWRITE(ini_entry->name->val, ini_entry->name->len); PUTS(" => "); - php_ini_displayer_cb(ini_entry, ZEND_INI_DISPLAY_ACTIVE TSRMLS_CC); + php_ini_displayer_cb(ini_entry, ZEND_INI_DISPLAY_ACTIVE); PUTS(" => "); - php_ini_displayer_cb(ini_entry, ZEND_INI_DISPLAY_ORIG TSRMLS_CC); + php_ini_displayer_cb(ini_entry, ZEND_INI_DISPLAY_ORIG); PUTS("\n"); } return 0; @@ -153,7 +153,7 @@ static int php_ini_displayer(zval *el, void *arg TSRMLS_DC) /* {{{ php_ini_available */ -static int php_ini_available(zval *el, void *arg TSRMLS_DC) +static int php_ini_available(zval *el, void *arg) { zend_ini_entry *ini_entry = (zend_ini_entry *)Z_PTR_P(el); int *module_number_available = (int *)arg; @@ -171,7 +171,6 @@ static int php_ini_available(zval *el, void *arg TSRMLS_DC) PHPAPI void display_ini_entries(zend_module_entry *module) { int module_number, module_number_available; - TSRMLS_FETCH(); if (module) { module_number = module->module_number; @@ -179,11 +178,11 @@ PHPAPI void display_ini_entries(zend_module_entry *module) module_number = 0; } module_number_available = module_number; - zend_hash_apply_with_argument(EG(ini_directives), php_ini_available, &module_number_available TSRMLS_CC); + zend_hash_apply_with_argument(EG(ini_directives), php_ini_available, &module_number_available); if (module_number_available == -1) { php_info_print_table_start(); php_info_print_table_header(3, "Directive", "Local Value", "Master Value"); - zend_hash_apply_with_argument(EG(ini_directives), php_ini_displayer, (void *)&module_number TSRMLS_CC); + zend_hash_apply_with_argument(EG(ini_directives), php_ini_displayer, (void *)&module_number); php_info_print_table_end(); } } @@ -343,23 +342,23 @@ static void php_ini_parser_cb(zval *arg1, zval *arg2, zval *arg3, int callback_t /* {{{ php_load_php_extension_cb */ -static void php_load_php_extension_cb(void *arg TSRMLS_DC) +static void php_load_php_extension_cb(void *arg) { #ifdef HAVE_LIBDL - php_load_extension(*((char **) arg), MODULE_PERSISTENT, 0 TSRMLS_CC); + php_load_extension(*((char **) arg), MODULE_PERSISTENT, 0); #endif } /* }}} */ /* {{{ php_load_zend_extension_cb */ -static void php_load_zend_extension_cb(void *arg TSRMLS_DC) +static void php_load_zend_extension_cb(void *arg) { char *filename = *((char **) arg); const int length = (int)strlen(filename); if (IS_ABSOLUTE_PATH(filename, length)) { - zend_load_extension(filename TSRMLS_CC); + zend_load_extension(filename); } else { char *libpath; char *extension_dir = INI_STR("extension_dir"); @@ -370,7 +369,7 @@ static void php_load_zend_extension_cb(void *arg TSRMLS_DC) } else { spprintf(&libpath, 0, "%s%c%s", extension_dir, DEFAULT_SLASH, filename); } - zend_load_extension(libpath TSRMLS_CC); + zend_load_extension(libpath); efree(libpath); } } @@ -378,7 +377,7 @@ static void php_load_zend_extension_cb(void *arg TSRMLS_DC) /* {{{ php_init_config */ -int php_init_config(TSRMLS_D) +int php_init_config(void) { char *php_ini_file_name = NULL; char *php_ini_search_path = NULL; @@ -552,7 +551,7 @@ int php_init_config(TSRMLS_D) if (!((statbuf.st_mode & S_IFMT) == S_IFDIR)) { fh.handle.fp = VCWD_FOPEN(php_ini_file_name, "r"); if (fh.handle.fp) { - fh.filename = php_ini_opened_path = expand_filepath(php_ini_file_name, NULL TSRMLS_CC); + fh.filename = php_ini_opened_path = expand_filepath(php_ini_file_name, NULL); } } } @@ -563,7 +562,7 @@ int php_init_config(TSRMLS_D) const char *fmt = "php-%s.ini"; char *ini_fname; spprintf(&ini_fname, 0, fmt, sapi_module.name); - fh.handle.fp = php_fopen_with_path(ini_fname, "r", php_ini_search_path, &php_ini_opened_path TSRMLS_CC); + fh.handle.fp = php_fopen_with_path(ini_fname, "r", php_ini_search_path, &php_ini_opened_path); efree(ini_fname); if (fh.handle.fp) { fh.filename = php_ini_opened_path; @@ -572,7 +571,7 @@ int php_init_config(TSRMLS_D) /* If still no ini file found, search for php.ini file in search path */ if (!fh.handle.fp) { - fh.handle.fp = php_fopen_with_path("php.ini", "r", php_ini_search_path, &php_ini_opened_path TSRMLS_CC); + fh.handle.fp = php_fopen_with_path("php.ini", "r", php_ini_search_path, &php_ini_opened_path); if (fh.handle.fp) { fh.filename = php_ini_opened_path; } @@ -589,7 +588,7 @@ int php_init_config(TSRMLS_D) fh.type = ZEND_HANDLE_FP; RESET_ACTIVE_INI_HASH(); - zend_parse_ini_file(&fh, 1, ZEND_INI_SCANNER_NORMAL, (zend_ini_parser_cb_t) php_ini_parser_cb, &configuration_hash TSRMLS_CC); + zend_parse_ini_file(&fh, 1, ZEND_INI_SCANNER_NORMAL, (zend_ini_parser_cb_t) php_ini_parser_cb, &configuration_hash); { zval tmp; @@ -664,7 +663,7 @@ int php_init_config(TSRMLS_D) fh2.filename = ini_file; fh2.type = ZEND_HANDLE_FP; - if (zend_parse_ini_file(&fh2, 1, ZEND_INI_SCANNER_NORMAL, (zend_ini_parser_cb_t) php_ini_parser_cb, &configuration_hash TSRMLS_CC) == SUCCESS) { + if (zend_parse_ini_file(&fh2, 1, ZEND_INI_SCANNER_NORMAL, (zend_ini_parser_cb_t) php_ini_parser_cb, &configuration_hash) == SUCCESS) { /* Here, add it to the list of ini files read */ l = (int)strlen(ini_file); total_l += l + 2; @@ -705,7 +704,7 @@ int php_init_config(TSRMLS_D) if (sapi_module.ini_entries) { /* Reset active ini section */ RESET_ACTIVE_INI_HASH(); - zend_parse_ini_string(sapi_module.ini_entries, 1, ZEND_INI_SCANNER_NORMAL, (zend_ini_parser_cb_t) php_ini_parser_cb, &configuration_hash TSRMLS_CC); + zend_parse_ini_string(sapi_module.ini_entries, 1, ZEND_INI_SCANNER_NORMAL, (zend_ini_parser_cb_t) php_ini_parser_cb, &configuration_hash); } return SUCCESS; @@ -731,10 +730,10 @@ int php_shutdown_config(void) /* {{{ php_ini_register_extensions */ -void php_ini_register_extensions(TSRMLS_D) +void php_ini_register_extensions(void) { - zend_llist_apply(&extension_lists.engine, php_load_zend_extension_cb TSRMLS_CC); - zend_llist_apply(&extension_lists.functions, php_load_php_extension_cb TSRMLS_CC); + zend_llist_apply(&extension_lists.engine, php_load_zend_extension_cb); + zend_llist_apply(&extension_lists.functions, php_load_php_extension_cb); zend_llist_destroy(&extension_lists.engine); zend_llist_destroy(&extension_lists.functions); @@ -743,7 +742,7 @@ void php_ini_register_extensions(TSRMLS_D) /* {{{ php_parse_user_ini_file */ -PHPAPI int php_parse_user_ini_file(const char *dirname, char *ini_filename, HashTable *target_hash TSRMLS_DC) +PHPAPI int php_parse_user_ini_file(const char *dirname, char *ini_filename, HashTable *target_hash) { zend_stat_t sb; char ini_file[MAXPATHLEN]; @@ -761,7 +760,7 @@ PHPAPI int php_parse_user_ini_file(const char *dirname, char *ini_filename, Hash /* Reset active ini section */ RESET_ACTIVE_INI_HASH(); - if (zend_parse_ini_file(&fh, 1, ZEND_INI_SCANNER_NORMAL, (zend_ini_parser_cb_t) php_ini_parser_cb, target_hash TSRMLS_CC) == SUCCESS) { + if (zend_parse_ini_file(&fh, 1, ZEND_INI_SCANNER_NORMAL, (zend_ini_parser_cb_t) php_ini_parser_cb, target_hash) == SUCCESS) { /* FIXME: Add parsed file to the list of user files read? */ return SUCCESS; } @@ -775,7 +774,7 @@ PHPAPI int php_parse_user_ini_file(const char *dirname, char *ini_filename, Hash /* {{{ php_ini_activate_config */ -PHPAPI void php_ini_activate_config(HashTable *source_hash, int modify_type, int stage TSRMLS_DC) +PHPAPI void php_ini_activate_config(HashTable *source_hash, int modify_type, int stage) { zend_string *str; zval *data; @@ -787,7 +786,7 @@ PHPAPI void php_ini_activate_config(HashTable *source_hash, int modify_type, int zend_hash_move_forward(source_hash) ) { data = zend_hash_get_current_data(source_hash); - zend_alter_ini_entry_ex(str, Z_STR_P(data), modify_type, stage, 0 TSRMLS_CC); + zend_alter_ini_entry_ex(str, Z_STR_P(data), modify_type, stage, 0); } } /* }}} */ @@ -802,7 +801,7 @@ PHPAPI int php_ini_has_per_dir_config(void) /* {{{ php_ini_activate_per_dir_config */ -PHPAPI void php_ini_activate_per_dir_config(char *path, size_t path_len TSRMLS_DC) +PHPAPI void php_ini_activate_per_dir_config(char *path, size_t path_len) { zval *tmp2; char *ptr; @@ -834,7 +833,7 @@ PHPAPI void php_ini_activate_per_dir_config(char *path, size_t path_len TSRMLS_D *ptr = 0; /* Search for source array matching the path from configuration_hash */ if ((tmp2 = zend_hash_str_find(&configuration_hash, path, strlen(path))) != NULL) { - php_ini_activate_config(Z_ARRVAL_P(tmp2), PHP_INI_SYSTEM, PHP_INI_STAGE_ACTIVATE TSRMLS_CC); + php_ini_activate_config(Z_ARRVAL_P(tmp2), PHP_INI_SYSTEM, PHP_INI_STAGE_ACTIVATE); } *ptr = '/'; ptr++; @@ -853,14 +852,14 @@ PHPAPI int php_ini_has_per_host_config(void) /* {{{ php_ini_activate_per_host_config */ -PHPAPI void php_ini_activate_per_host_config(const char *host, size_t host_len TSRMLS_DC) +PHPAPI void php_ini_activate_per_host_config(const char *host, size_t host_len) { zval *tmp; if (has_per_host_config && host && host_len) { /* Search for source array matching the host from configuration_hash */ if ((tmp = zend_hash_str_find(&configuration_hash, host, host_len)) != NULL) { - php_ini_activate_config(Z_ARRVAL_P(tmp), PHP_INI_SYSTEM, PHP_INI_STAGE_ACTIVATE TSRMLS_CC); + php_ini_activate_config(Z_ARRVAL_P(tmp), PHP_INI_SYSTEM, PHP_INI_STAGE_ACTIVATE); } } } |