helly           Tue Dec 30 19:08:54 2008 UTC

  Modified files:              (Branch: PHP_5_3)
    /php-src/main       php_ini.c 
  Log:
  - MFH 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.136.2.4.2.15.2.11&r2=1.136.2.4.2.15.2.12&diff_format=u
Index: php-src/main/php_ini.c
diff -u php-src/main/php_ini.c:1.136.2.4.2.15.2.11 
php-src/main/php_ini.c:1.136.2.4.2.15.2.12
--- php-src/main/php_ini.c:1.136.2.4.2.15.2.11  Wed Aug 13 17:49:13 2008
+++ php-src/main/php_ini.c      Tue Dec 30 19:08:54 2008
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: php_ini.c,v 1.136.2.4.2.15.2.11 2008/08/13 17:49:13 pajoye Exp $ */
+/* $Id: php_ini.c,v 1.136.2.4.2.15.2.12 2008/12/30 19:08:54 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