helly           Tue Dec 30 19:08:43 2008 UTC

  Modified files:              
    /php-src/main       php_ini.c 
  Log:
  - Do not show empty ini directive tables for modules without ini entries.
  
http://cvs.php.net/viewvc.cgi/php-src/main/php_ini.c?r1=1.169&r2=1.170&diff_format=u
Index: php-src/main/php_ini.c
diff -u php-src/main/php_ini.c:1.169 php-src/main/php_ini.c:1.170
--- php-src/main/php_ini.c:1.169        Wed Aug 13 21:51:54 2008
+++ php-src/main/php_ini.c      Tue Dec 30 19:08:42 2008
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: php_ini.c,v 1.169 2008/08/13 21:51:54 pajoye Exp $ */
+/* $Id: php_ini.c,v 1.170 2008/12/30 19:08:42 helly Exp $ */
 
 #include "php.h"
 #include "ext/standard/info.h"
@@ -132,11 +132,24 @@
 }
 /* }}} */
 
+/* {{{ 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) {
@@ -144,10 +157,14 @@
        } 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();
+       }
 }
 /* }}} */
 



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to