]> granicus.if.org Git - php/commitdiff
phpinfo() prettying
authorColin Viebrock <cmv@php.net>
Wed, 5 Apr 2000 22:30:19 +0000 (22:30 +0000)
committerColin Viebrock <cmv@php.net>
Wed, 5 Apr 2000 22:30:19 +0000 (22:30 +0000)
I will get to the rest of the functions later tonight or tomorrow
(i.e. from hyperwave to snmp)

ext/aspell/aspell.c
ext/cpdf/cpdf.c
ext/dav/dav.c
ext/db/db.c
ext/dba/dba.c
ext/domxml/domxml.c
ext/fdf/fdf.c
ext/gd/gd.c
ext/gettext/gettext.c
ext/standard/info.c

index 74d8a73df1e326475ca20728139c9bf6c0d4843e..b890f212e2c66cdd93d58bdab0d6d6233e6aa866 100644 (file)
@@ -19,6 +19,7 @@
 /* $Id$ */
 
 #include "php.h"
+
 #if defined(COMPILE_DL)
 #include "phpdl.h"
 #endif
@@ -30,6 +31,7 @@
 
 #include "php_aspell.h"
 #include <aspell-c.h>
+#include "ext/standard/info.h"
 
 function_entry aspell_functions[] = {
        PHP_FE(aspell_new,                                                              NULL)
@@ -194,8 +196,9 @@ PHP_FUNCTION(aspell_check_raw)
 
 PHP_MINFO_FUNCTION(aspell)
 {
-       php_printf("ASpell support enabled");
-
+       php_info_print_table_start();
+       php_info_print_table_row(2, "ASpell Support", "enabled");
+       php_info_print_table_end();
 }
 
 #endif
index 973f7ca5dc1519d306f6275ee9f6d98e0393e587..30a9b2840b8265531adb7d64917f72ee72a163cb 100644 (file)
@@ -42,7 +42,6 @@
 #include "php_globals.h"
 #include "ext/standard/php_standard.h"
 #include "ext/standard/head.h"
-#include "ext/standard/info.h"
 #include <math.h>
 #if HAVE_LIBGD13
 #include <gd.h>
@@ -58,6 +57,7 @@
 
 #if HAVE_CPDFLIB
 #include "php_cpdf.h"
+#include "ext/standard/info.h"
 
 #ifdef THREAD_SAFE
 DWORD CPDFlibTls;
@@ -187,7 +187,11 @@ PHP_RINIT_FUNCTION(cpdf)
 
 PHP_MINFO_FUNCTION(cpdf) {
        /* need to use a PHPAPI function here because it is external module in windows */
-       php_printf("Version %s", cpdf_version());
+       /* (don't knwo if that still applies (cmv) */
+       php_info_print_table_start();
+       php_info_print_table_row(2, "CPDF Support", "enabled");
+       php_info_print_table_row(2, "Version", cpdf_version() );
+       php_info_print_table_end();
 }
 
 PHP_MSHUTDOWN_FUNCTION(cpdf){
index 89a6c27ca89cf9a6cf68b290724773f67cb55ed6..021ac4741ff29fbb97fc22ddfffd8c999f29647a 100644 (file)
@@ -36,6 +36,7 @@
 #if HAVE_MOD_DAV
 
 # include "mod_dav.h"
+#include "ext/standard/info.h"
 
 /* {{{ thread safety stuff */
 
@@ -158,6 +159,9 @@ PHP_RSHUTDOWN_FUNCTION(phpdav)
 
 PHP_MINFO_FUNCTION(phpdav);
 {
+       php_info_print_table_start();
+       php_info_print_table_row(2, "DAV Support", "enabled");
+       php_info_print_table_end();
 }
 
 /* {{{ extension-internal functions */
index 8d7fc7cb5cd0197da61dba82d8f1ab4f6f8b1359..bc131aa7598fa5e0af23d8f5a83b6ef779611eed 100644 (file)
@@ -30,6 +30,7 @@
 #include "safe_mode.h"
 #include "fopen-wrappers.h"
 #include "ext/standard/flock_compat.h" 
+#include "ext/standard/info.h"
 
 #include <stdlib.h>
 #include <string.h>
@@ -230,7 +231,10 @@ static char *php_get_info_db(void)
 
 PHP_MINFO_FUNCTION(db)
 {
+       /* this isn't pretty ... should break out the info a bit more (cmv) */
+       php_info_print_box_start(0);
        php_printf(php_get_info_db());
+       php_info_print_box_end();
 }
 
 PHP_FUNCTION(dblist)
index 6e40c9c8e9222603d7ddbc7ef7b998309bf79ecf..ab5ebb1dd289436b244dcb842d0a534776bd1553 100644 (file)
@@ -34,6 +34,7 @@
 #if HAVE_DBA
 
 #include "php_dba.h"
+#include "ext/standard/info.h"
 
 #include "php_gdbm.h"
 #include "php_ndbm.h"
@@ -197,6 +198,8 @@ static PHP_MSHUTDOWN_FUNCTION(dba)
 
 static PHP_MINFO_FUNCTION(dba)
 {
+       /* could be prettier (cmv) */
+       php_info_print_box_start();
        dba_handler *hptr;
        
        PUTS("V1 ($Id$)");
@@ -204,6 +207,7 @@ static PHP_MINFO_FUNCTION(dba)
                PUTS(" ");
                PUTS(hptr->name);
        }
+       php_info_print_box_end();
 }
 
 static void php_dba_update(INTERNAL_FUNCTION_PARAMETERS, int mode)
index 599becb57f8d02bda78e26de6acc845f27eba89e..7c397961d0e9a8098b2533abb4bbf9094bebc175 100644 (file)
@@ -23,6 +23,7 @@
 #include "php_domxml.h"
 
 #if HAVE_DOMXML
+#include "ext/standard/info.h"
 //#define newcode
 
 static int le_domxmldocp;
@@ -313,9 +314,11 @@ PHP_FUNCTION(domxml_test)
 
 PHP_MINFO_FUNCTION(domxml)
 {
-               PUTS("DOM/XML support active (compiled with libxml ");
-//             php_printf("%s", LIBXML_VERSION);
-               PUTS(".)");
+       /* don't know why that line was commented out in the previous version, so i left it (cmv) */
+       php_info_print_table_start();
+       php_info_print_table_row(2, "DOM/XML Support", "enabled");
+//     php_info_print_table_row(2, "libmxl Version", LIBXML_VERSION );
+       php_info_print_table_end();
 }
 
 /* {{{ proto string domxml_attrname([int dir_handle])
index 75817a68c6805d28e2cf722e972eb637bb0095e1..0c75cc98b8d25ab5c4ea97a3e3ddb20c419125a0 100644 (file)
@@ -61,6 +61,8 @@
 
 #if HAVE_FDFLIB
 
+#include "ext/standard/info.h"
+
 #ifdef THREAD_SAFE
 DWORD FDFlibTls;
 static int numthreads=0;
@@ -123,7 +125,10 @@ PHP_MINIT_FUNCTION(fdf)
 PHP_MINFO_FUNCTION(fdf)
 {
        /* need to use a PHPAPI function here because it is external module in windows */
-       php_printf("FdfTk Version %s", FDFGetVersion());
+       php_info_print_table_start();
+       php_info_print_table_row(2, "FDF Support", "enabled");
+       php_info_print_table_row(2, "FdfTk Version", FDFGetVersion() );
+       php_info_print_table_end();
 }
 
 PHP_MSHUTDOWN_FUNCTION(fdf)
index 50ffb70b5e67a45dff570af0d6e2872e8808e714..2ca2b9182edb5c335c0d2069a335043c6a16ae3a 100644 (file)
@@ -43,6 +43,9 @@
 #endif
 
 #if HAVE_LIBGD
+
+#include "ext/standard/info.h"
+
 #include <gd.h>
 #include <gdfontt.h>  /* 1 Tiny font */
 #include <gdfonts.h>  /* 2 Small font */
@@ -221,34 +224,39 @@ PHP_MINIT_FUNCTION(gd)
 
 PHP_MINFO_FUNCTION(gd)
 {
+       php_info_print_table_start();
+       php_info_print_table_row(2, "GD Support", "enabled");
+
        /* need to use a PHPAPI function here because it is external module in windows */
+
 #if HAVE_GDIMAGECOLORRESOLVE
-       php_printf("Version 1.6.2 or higher");
+       php_info_print_table_row(2, "GD Version", "1.6.2 or higher");
 #elif HAVE_LIBGD13
-       php_printf("Version between 1.3 and 1.6.1");
+       php_info_print_table_row(2, "GD Version", "between 1.3 and 1.6.1");
 #else
-       php_printf("Version 1.2");
+       php_info_print_table_row(2, "GD Version", "1.2");
 #endif
 
 #ifdef ENABLE_GD_TTF
-       php_printf(" with FreeType support");
+       php_info_print_table_row(2, "FreeType Support", "enabled");
 #if HAVE_LIBFREETYPE
-       php_printf(" (linked with freetype)");
+       php_info_print_table_row(2, "FreeType Linkage", "with freetype");
 #elif HAVE_LIBTTF
-       php_printf(" (linked with ttf library)");
+       php_info_print_table_row(2, "FreeType Linkage", "with TTF library");
 #else
-       php_printf(" (linked with unknown library)");
+       php_info_print_table_row(2, "FreeType Linkage", "with unknown library");
 #endif
 #endif
 
-   php_printf(" which supports:");
-   
+/* this next part is stupid ... if I knew better, I'd put them all on one row (cmv) */
+
 #ifdef HAVE_GD_GIF
-       php_printf(" GIF");
+       php_info_print_table_row(2, "GIF Support", "enabled);
 #endif
 #ifdef HAVE_GD_PNG
-       php_printf(" PNG");
+       php_info_print_table_row(2, "PNG Support", "enabled);
 #endif
+       php_info_print_table_end();
 }
 
 /* Need this for cpdf. See also comment in file.c php3i_get_le_fp() */
index 3a0cac4144c1e57c420a80d33aeff9b0b0406e8a..8ef9adfd7964a95c981c478ee4f4a8d05e95b39d 100644 (file)
@@ -25,6 +25,7 @@
 #if HAVE_LIBINTL
 
 #include <libintl.h>
+#include "ext/standard/info.h"
 
 function_entry php_gettext_functions[] = {
     PHP_FE(textdomain,                                                         NULL)
@@ -42,7 +43,9 @@ zend_module_entry php_gettext_module_entry = {
 
 PHP_MINFO_FUNCTION(gettext)
 {
-       php_printf("GNU gettext support active.");
+       php_info_print_table_start();
+       php_info_print_table_row(2, "GNU GetText Support", "enabled");
+       php_info_print_table_end();
 }
 
 /* {{{ proto string textdomain(string domain)
index f980bec01addcd9120b905d5a6be518c9d3f5d64..db7f06f2c70f9b89653fd99a6a243226d7f1ea4b 100644 (file)
@@ -193,7 +193,7 @@ PHPAPI void php_print_info(int flag)
                        }
                        PUTS("?=PHPE9568F35-D428-11d2-A769-00AA001ACF42\" border=\"0\" align=\"right\"></a>\n");
                }
-               php_printf("This program makes use of the Zend scripting language engine:<br><pre>%s</pre>", get_zend_version());
+               php_printf("This program makes use of the Zend scripting language engine:<BR>%s<BR>\n", get_zend_version());
                php_info_print_box_end();
        }