Permalink
Browse files

- MFH Do not show empty ini directive tables for modules without ini …

…entries.
  • Loading branch information...
1 parent 7cfc6b9 commit d6d41215463d623257f11a8602ca97288aa71b44 Marcus Boerger committed Dec 30, 2008
Showing with 22 additions and 5 deletions.
  1. +22 −5 main/php_ini.c
View
@@ -132,22 +132,39 @@ static int php_ini_displayer(zend_ini_entry *ini_entry, int module_number TSRMLS
}
/* }}} */
+/* {{{ php_ini_available
+ */
+static int php_ini_available(zend_ini_entry *ini_entry, int *module_number_available TSRMLS_DC)
+{
+ if (ini_entry->module_number == *module_number_available) {
+ *module_number_available = -1;
+ return ZEND_HASH_APPLY_STOP;
+ } else {
+ return ZEND_HASH_APPLY_KEEP;
+ }
+}
+/* }}} */
+
/* {{{ display_ini_entries
*/
PHPAPI void display_ini_entries(zend_module_entry *module)
{
- int module_number;
+ int module_number, module_number_available;
TSRMLS_FETCH();
if (module) {
module_number = module->module_number;
} else {
module_number = 0;
}
- php_info_print_table_start();
- php_info_print_table_header(3, "Directive", "Local Value", "Master Value");
- zend_hash_apply_with_argument(EG(ini_directives), (apply_func_arg_t) php_ini_displayer, (void *) (zend_intptr_t) module_number TSRMLS_CC);
- php_info_print_table_end();
+ module_number_available = module_number;
+ zend_hash_apply_with_argument(EG(ini_directives), (apply_func_arg_t) php_ini_available, &module_number_available TSRMLS_CC);
+ 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), (apply_func_arg_t) php_ini_displayer, (void *) (zend_intptr_t) module_number TSRMLS_CC);
+ php_info_print_table_end();
+ }
}
/* }}} */

0 comments on commit d6d4121

Please sign in to comment.