]> granicus.if.org Git - php/commitdiff
- Show version and ini entries as default module info.
authorMarcus Boerger <helly@php.net>
Tue, 30 Dec 2008 19:10:22 +0000 (19:10 +0000)
committerMarcus Boerger <helly@php.net>
Tue, 30 Dec 2008 19:10:22 +0000 (19:10 +0000)
ext/standard/info.c

index 758249caf0e10db49cd5d41a35b972b09b3be25f..5b647105c54b316498e2fbada8ad97254f91278a 100644 (file)
@@ -194,26 +194,29 @@ static void php_info_print_stream_hash(const char *name, HashTable *ht TSRMLS_DC
 }
 /* }}} */
 
-PHPAPI void php_info_print_module(zend_module_entry *module TSRMLS_DC) /* {{{ */
+PHPAPI void php_info_print_module(zend_module_entry *zend_module TSRMLS_DC) /* {{{ */
 {
-       if (module->info_func) {
+       if (zend_module->info_func || zend_module->version) {
                if (!sapi_module.phpinfo_as_text) {
-                       php_info_printf("<h2><a name=\"module_%s\">%s</a></h2>\n", module->name, module->name);
+                       php_info_printf("<h2><a name=\"module_%s\">%s</a></h2>\n", zend_module->name, zend_module->name);
                } else {
                        php_info_print_table_start();
-                       php_info_print_table_header(1, module->name);
+                       php_info_print_table_header(1, zend_module->name);
                        php_info_print_table_end();
                }
-               module->info_func(module TSRMLS_CC);
+               if (zend_module->info_func) {
+                       zend_module->info_func(zend_module TSRMLS_CC);
+               } else {
+                       php_info_print_table_start();
+                       php_info_print_table_row(2, "Version", zend_module->version);
+                       php_info_print_table_end();
+                       DISPLAY_INI_ENTRIES();
+               }
        } else {
                if (!sapi_module.phpinfo_as_text) {
-                       php_info_printf("<tr>");
-                       php_info_printf("<td>");
-                       php_info_printf("%s", module->name);
-                       php_info_printf("</td></tr>\n");
+                       php_info_printf("<tr><td>%s</td></tr>\n", zend_module->name);
                } else {
-                       php_info_printf("%s", module->name);
-                       php_info_printf("\n");
+                       php_info_printf("%s\n", zend_module->name);
                }       
        }
 }
@@ -221,7 +224,7 @@ PHPAPI void php_info_print_module(zend_module_entry *module TSRMLS_DC) /* {{{ */
 
 static int _display_module_info_func(zend_module_entry *module TSRMLS_DC) /* {{{ */
 {
-       if (module->info_func) {
+       if (module->info_func || module->version) {
                php_info_print_module(module TSRMLS_CC);
        }
        return ZEND_HASH_APPLY_KEEP;
@@ -230,7 +233,7 @@ static int _display_module_info_func(zend_module_entry *module TSRMLS_DC) /* {{{
 
 static int _display_module_info_def(zend_module_entry *module TSRMLS_DC) /* {{{ */
 {
-       if (!module->info_func) {
+       if (!module->info_func && !module->version) {
                php_info_print_module(module TSRMLS_CC);
        }
        return ZEND_HASH_APPLY_KEEP;
@@ -862,7 +865,7 @@ PHPAPI void php_print_info(int flag TSRMLS_DC)
 
                SECTION("Additional Modules");
                php_info_print_table_start();
-               php_info_print_table_header(1, "Module Name");
+               php_info_print_table_header(2, "Module Name");
                zend_hash_apply(&sorted_registry, (apply_func_t) _display_module_info_def TSRMLS_CC);
                php_info_print_table_end();