diff options
author | Colin Viebrock <cmv@php.net> | 2000-04-06 21:07:44 +0000 |
---|---|---|
committer | Colin Viebrock <cmv@php.net> | 2000-04-06 21:07:44 +0000 |
commit | a7c8bfb9fb2d20341181c3ab351fc436a4cc0e2a (patch) | |
tree | 7178e45bc4ef17f47f744fd6c1517362734ded68 | |
parent | 56fc855afdde5270d9b6558734bd476669224e1d (diff) | |
download | php-git-a7c8bfb9fb2d20341181c3ab351fc436a4cc0e2a.tar.gz |
phpinfo() prettying
-rw-r--r-- | ext/interbase/interbase.c | 12 | ||||
-rw-r--r-- | ext/msql/php_msql.c | 32 | ||||
-rw-r--r-- | ext/mssql/php_mssql.c | 12 | ||||
-rw-r--r-- | ext/mysql/php_mysql.c | 7 | ||||
-rw-r--r-- | ext/oci8/oci8.c | 13 | ||||
-rw-r--r-- | ext/odbc/php_odbc.c | 11 | ||||
-rw-r--r-- | ext/odbc/velocis.c | 5 | ||||
-rw-r--r-- | ext/oracle/oracle.c | 14 | ||||
-rw-r--r-- | ext/pcre/php_pcre.c | 1 | ||||
-rw-r--r-- | ext/pdf/pdf.c | 21 | ||||
-rw-r--r-- | ext/recode/recode.c | 9 | ||||
-rw-r--r-- | ext/session/session.c | 6 | ||||
-rw-r--r-- | ext/snmp/snmp.c | 7 | ||||
-rw-r--r-- | ext/sybase/sybase.c | 40 | ||||
-rw-r--r-- | ext/sybase_ct/php_sybase_ct.c | 37 |
15 files changed, 136 insertions, 91 deletions
diff --git a/ext/interbase/interbase.c b/ext/interbase/interbase.c index 3d06f41ed1..4d05a5bf27 100644 --- a/ext/interbase/interbase.c +++ b/ext/interbase/interbase.c @@ -512,7 +512,7 @@ PHP_RSHUTDOWN_FUNCTION(ibase) PHP_MINFO_FUNCTION(ibase) { - char tmp[128]; + char tmp[32]; IBLS_FETCH(); @@ -525,17 +525,19 @@ PHP_MINFO_FUNCTION(ibase) php_info_print_table_row(2, "Allow Persistent Links", (IBG(allow_persistent)?"Yes":"No") ); if (IBG(max_persistent) == -1) { - snprintf(tmp, 128, "%d/unlimited", IBG(num_persistent)); + snprintf(tmp, 31, "%d/unlimited", IBG(num_persistent)); } else { - snprintf(tmp, 128, "%d/%ld", IBG(num_persistent), IBG(max_persistent)); + snprintf(tmp, 31, "%d/%ld", IBG(num_persistent), IBG(max_persistent)); } + tmp[31]=0; php_info_print_table_row(2, "Persistent Links", tmp ); if (IBG(max_links) == -1) { - snprintf(tmp, 128, "%d/unlimited", IBG(num_links)); + snprintf(tmp, 31, "%d/unlimited", IBG(num_links)); } else { - snprintf(tmp, 128, "%d/%ld", IBG(num_links), IBG(max_links)); + snprintf(tmp, 31, "%d/%ld", IBG(num_links), IBG(max_links)); } + tmp[31]=0; php_info_print_table_row(2, "Total Links", tmp ); php_info_print_table_row(2, "Time Format", IBG(timeformat) ); diff --git a/ext/msql/php_msql.c b/ext/msql/php_msql.c index 8d8326ba98..78572359fe 100644 --- a/ext/msql/php_msql.c +++ b/ext/msql/php_msql.c @@ -25,6 +25,7 @@ #endif #include "php_msql.h" #include "ext/standard/php_standard.h" +#include "ext/standard/info.h" #include "php_globals.h" #if HAVE_MSQL @@ -186,28 +187,29 @@ DLEXPORT PHP_RINIT_FUNCTION(msql) DLEXPORT PHP_MINFO_FUNCTION(msql) { - char maxp[16],maxl[16]; + char maxp[32],maxl[32]; if (msql_globals.max_persistent==-1) { - strcpy(maxp,"Unlimited"); + snprintf(maxp, 31, "%d/unlimited", msql_globals.num_persistent ); } else { - snprintf(maxp,15,"%ld",msql_globals.max_persistent); - maxp[15]=0; + snprintf(maxp, 31, "%d/%ld", msql_globals.num_persistent, msql_globals.max_persistent); } + maxp[31]=0; + if (msql_globals.max_links==-1) { - strcpy(maxl,"Unlimited"); + snprintf(maxl, 15, "%d/unlimited", msql_globals.num_links ); } else { - snprintf(maxl,15,"%ld",msql_globals.max_links); - maxl[15]=0; + snprintf(maxl, 15, "%d/%ld", msql_globals.num_links, msql_globals.max_links); } - php_printf("<table>" - "<tr><td>Allow persistent links:</td><td>%s</td></tr>\n" - "<tr><td>Persistent links:</td><td>%d/%s</td></tr>\n" - "<tr><td>Total links:</td><td>%d/%s</td></tr>\n" - "</table>\n", - (msql_globals.allow_persistent?"Yes":"No"), - msql_globals.num_persistent,maxp, - msql_globals.num_links,maxl); + maxl[31]=0; + + php_info_print_table_start(); + php_info_print_table_row(2, "MSQL Support", "enabled" ); + php_info_print_table_row(2, "Allow Persistent Links", (msql_globals.allow_persistent?"yes":"no") ); + php_info_print_table_row(2, "Persistent Links", maxp ); + php_info_print_table_row(2, "Total Links", maxl ); + php_info_print_table_end(); + } diff --git a/ext/mssql/php_mssql.c b/ext/mssql/php_mssql.c index b1f715b898..5f2003adf2 100644 --- a/ext/mssql/php_mssql.c +++ b/ext/mssql/php_mssql.c @@ -26,6 +26,7 @@ #include "php.h" #include "php_globals.h" #include "ext/standard/php_standard.h" +#include "ext/standard/info.h" #include "php_mssql.h" #include "php_ini.h" @@ -271,10 +272,8 @@ PHP_MINFO_FUNCTION(mssql) char buf[32]; MSSQLLS_FETCH(); - DISPLAY_INI_ENTRIES(); - - php_printf("<table border=5 width=\"600\">"); - php_info_print_table_header(2, "Key", "Value"); + php_info_print_table_start(); + php_info_print_table_header(2, "MSSQL Support", "enabled"); sprintf(buf, "%ld", MS_SQL_G(num_persistent)); php_info_print_table_row(2, "Active Persistent Links", buf); @@ -282,7 +281,10 @@ PHP_MINFO_FUNCTION(mssql) php_info_print_table_row(2, "Active Links", buf); php_info_print_table_row(2, "Library version", MSSQL_VERSION); - php_printf("</table>\n"); + php_info_print_table_end(); + + DISPLAY_INI_ENTRIES(); + } void php_mssql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) diff --git a/ext/mysql/php_mysql.c b/ext/mysql/php_mysql.c index 5406880e09..8f9d5cb677 100644 --- a/ext/mysql/php_mysql.c +++ b/ext/mysql/php_mysql.c @@ -291,10 +291,8 @@ PHP_MINFO_FUNCTION(mysql) char buf[32]; MySLS_FETCH(); - DISPLAY_INI_ENTRIES(); - php_info_print_table_start(); - php_info_print_table_header(2, "Key", "Value"); + php_info_print_table_header(2, "MySQL Support", "enabled"); sprintf(buf, "%ld", MySG(num_persistent)); php_info_print_table_row(2, "Active Persistent Links", buf); sprintf(buf, "%ld", MySG(num_links)); @@ -306,6 +304,9 @@ PHP_MINFO_FUNCTION(mysql) php_info_print_table_row(2, "MYSQL_LIBS", PHP_MYSQL_LIBS); #endif php_info_print_table_end(); + + DISPLAY_INI_ENTRIES(); + } diff --git a/ext/oci8/oci8.c b/ext/oci8/oci8.c index 4b30a4ebb8..39a57812cc 100644 --- a/ext/oci8/oci8.c +++ b/ext/oci8/oci8.c @@ -55,6 +55,7 @@ #include "php.h" #include "ext/standard/head.h" +#include "ext/standard/info.h" #if HAVE_OCI8 @@ -490,12 +491,16 @@ PHP_RSHUTDOWN_FUNCTION(oci) PHP_MINFO_FUNCTION(oci) { + + php_info_print_table_start(); + php_info_print_table_row(2, "OCI8 Support", "enabled"); #if !(WIN32|WINNT) - php_printf("Oracle version: %s<br>\n" - "Compile-time ORACLE_HOME: %s<br>\n" - "Libraries used: %s", - PHP_ORACLE_VERSION, PHP_ORACLE_HOME, PHP_ORACLE_LIBS); + php_info_print_table_row(2, "Oracle Version", PHP_ORACLE_VERSION ); + php_info_print_table_row(2, "Compile-time ORACLE_HOME", PHP_ORACLE_HOME ); + php_info_print_table_row(2, "Libraries Used", PHP_ORACLE_LIBS ); #endif + php_info_print_table_end(); + } /* }}} */ diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c index c7abe1b036..5b884049f7 100644 --- a/ext/odbc/php_odbc.c +++ b/ext/odbc/php_odbc.c @@ -435,10 +435,8 @@ PHP_MINFO_FUNCTION(odbc) char buf[32]; ODBCLS_FETCH(); - DISPLAY_INI_ENTRIES(); - - php_printf("<table border=5 width=\"600\">"); - php_info_print_table_header(2, "Key", "Value"); + php_info_print_table_start(); + php_info_print_table_header(2, "ODBC Support", "enabled"); sprintf(buf, "%ld", ODBCG(num_persistent)); php_info_print_table_row(2, "Active Persistent Links", buf); sprintf(buf, "%ld", ODBCG(num_links)); @@ -449,7 +447,10 @@ PHP_MINFO_FUNCTION(odbc) php_info_print_table_row(2, "ODBC_LFLAGS", PHP_ODBC_LFLAGS); php_info_print_table_row(2, "ODBC_LIBS", PHP_ODBC_LIBS); #endif - php_printf("</table>\n"); + php_info_print_table_end(); + + DISPLAY_INI_ENTRIES(); + } #if defined ( HAVE_IBMDB2 ) || defined ( HAVE_UNIXODBC ) diff --git a/ext/odbc/velocis.c b/ext/odbc/velocis.c index faf53bc624..70d7b958dc 100644 --- a/ext/odbc/velocis.c +++ b/ext/odbc/velocis.c @@ -42,6 +42,7 @@ #ifdef HAVE_VELOCIS #include "php_velocis.h" +#include "ext/standard/info.h" function_entry velocis_functions[] = { PHP_FE(velocis_connect, NULL) @@ -115,7 +116,9 @@ PHP_RINIT_FUNCTION(velocis) PHP_MINFO_FUNCTION(velocis) { - php_printf("RAIMA Velocis Support Active"); + php_info_print_table_start(); + php_info_print_table_row(2, "RAIMA Velocis Support", "enabled" ); + php_info_print_table_end(); } PHP_MSHUTDOWN_FUNCTION(velocis) diff --git a/ext/oracle/oracle.c b/ext/oracle/oracle.c index 9cd96c6938..35dcb98b36 100644 --- a/ext/oracle/oracle.c +++ b/ext/oracle/oracle.c @@ -38,6 +38,8 @@ #include "php_oracle.h" #define HASH_DTOR (void (*)(void *)) +#include "ext/standard/info.h" + #ifdef WIN32 # include "variables.h" #else @@ -1511,12 +1513,16 @@ PHP_FUNCTION(ora_errorcode) PHP_MINFO_FUNCTION(oracle) { + + php_info_print_table_start(); + php_info_print_table_row(2, "Oracle Support", "enabled"); + #ifndef PHP_WIN32 - php_printf("Oracle version: %s<br>\n" - "Compile-time ORACLE_HOME: %s<br>\n" - "Libraries used: %s", - PHP_ORACLE_VERSION, PHP_ORACLE_HOME, PHP_ORACLE_LIBS); + php_info_print_table_row(2, "Oracle Version", PHP_ORACLE_VERSION ); + php_info_print_table_row(2, "Compile-time ORACLE_HOME", PHP_ORACLE_HOME ); + php_info_print_table_row(2, "Libraries Used", PHP_ORACLE_LIBS ); #endif + php_info_print_table_end(); } diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c index e38021012e..7a9289803f 100644 --- a/ext/pcre/php_pcre.c +++ b/ext/pcre/php_pcre.c @@ -89,6 +89,7 @@ static /* {{{ PHP_MINFO_FUNCTION(pcre) */ PHP_MINFO_FUNCTION(pcre) { php_info_print_table_start(); + php_info_print_table_row(2, "PCRE (Perl Compatible Regular Expressions) Support", "enabled" ); php_info_print_table_row(2, "PCRE Library Version", pcre_version() ); php_info_print_table_end(); } diff --git a/ext/pdf/pdf.c b/ext/pdf/pdf.c index 1181d1e24a..918ba338c4 100644 --- a/ext/pdf/pdf.c +++ b/ext/pdf/pdf.c @@ -41,6 +41,7 @@ #include "php.h" #include "php_globals.h" #include "ext/standard/head.h" +#include "ext/standard/info.h" #include <math.h> @@ -235,13 +236,23 @@ PHP_MINIT_FUNCTION(pdf) return SUCCESS; } -PHP_MINFO_FUNCTION(pdf) { - /* need to use a PHPAPI function here because it is external module in windows */ - php_printf("pdflib %d.%02d<BR>", PDF_get_majorversion(), PDF_get_minorversion()); - php_printf("The CJK fonts supported."); +PHP_MINFO_FUNCTION(pdf) +{ + char tmp[32]; + + snprintf(tmp, 31, "%d.%02d", PDF_get_majorversion(), PDF_get_minorversion() ); + tmp[32]=0; + + php_info_print_table_start(); + php_info_print_table_row(2, "PDF Support", "enabled" ); + php_info_print_table_row(2, "PDFLib Version", tmp ); + php_info_print_table_row(2, "CJK Font Support", "yes" ); #ifdef PDF_OPEN_MEM_SUPPORTED - php_printf("Support for in memory pdf creation."); + php_info_print_table_row(2, "In-memory PDF Creation Support", "yes" ); +#else + php_info_print_table_row(2, "In-memory PDF Creation Support", "no" ); #endif + php_info_print_table_end(); } diff --git a/ext/recode/recode.c b/ext/recode/recode.c index 51762ba6fd..8967e8c202 100644 --- a/ext/recode/recode.c +++ b/ext/recode/recode.c @@ -90,10 +90,11 @@ PHP_MINFO_FUNCTION(recode) { ReSLS_FETCH(); - php_printf("<table border=5 width=\"600\">"); - php_info_print_table_header(1, "Module Revision"); - php_info_print_table_row(1, "$Revision$"); - php_printf("</table>\n"); + php_info_print_table_start(); + php_info_print_table_row(2, "Recode Support", "enabled); + php_info_print_table_row(2, "Revision", "$Revision$"); + php_info_print_table_end(); + } /* {{{ proto string recode_string(string request, string str) diff --git a/ext/session/session.c b/ext/session/session.c index 0c268ede5d..589759e69c 100644 --- a/ext/session/session.c +++ b/ext/session/session.c @@ -38,6 +38,7 @@ #include "ext/standard/url_scanner.h" #include "ext/standard/php_output.h" #include "ext/standard/php_rand.h" /* for RAND_MAX */ +#include "ext/standard/info.h" #ifdef ZTS int ps_globals_id; @@ -1321,5 +1322,10 @@ PHP_MSHUTDOWN_FUNCTION(session) PHP_MINFO_FUNCTION(session) { + + php_info_print_table_start(); + php_info_print_table_row(2, "Session Support", "enabled" ); + php_info_print_table_end(); + DISPLAY_INI_ENTRIES(); } diff --git a/ext/snmp/snmp.c b/ext/snmp/snmp.c index 4368819810..5bcc552a9a 100644 --- a/ext/snmp/snmp.c +++ b/ext/snmp/snmp.c @@ -20,6 +20,7 @@ /* $Id$ */ #include "php.h" +#include "ext/standard/info.h" #if defined(COMPILE_DL) #include "dl/phpdl.h" #endif @@ -105,7 +106,9 @@ PHP_MINIT_FUNCTION(snmp) PHP_MINFO_FUNCTION(snmp) { - php_printf("ucd-snmp"); + php_info_print_table_start(); + php_info_print_table_row(2, "UCD-SNMP Support", "enabled"); + php_info_print_table_end(); } @@ -381,4 +384,4 @@ PHP_FUNCTION(snmpset) { * tab-width: 4 * c-basic-offset: 4 * End: -*/
\ No newline at end of file +*/ diff --git a/ext/sybase/sybase.c b/ext/sybase/sybase.c index c90212b2d5..a92b95fc4e 100644 --- a/ext/sybase/sybase.c +++ b/ext/sybase/sybase.c @@ -26,6 +26,7 @@ #include "php.h" #include "php_sybase.h" #include "ext/standard/php_standard.h" +#include "ext/standard/info.h" #include "php_globals.h" #if HAVE_SYBASE @@ -1185,32 +1186,31 @@ PHP_FUNCTION(sybase_result) PHP_MINFO_FUNCTION(sybase) { - char maxp[16],maxl[16]; + char maxp[32],maxl[32]; if (php_sybase_module.max_persistent==-1) { - strcpy(maxp,"Unlimited"); + snprintf(maxp, 31, "%d/unlimited", php_sybase_module.num_persistent ) } else { - snprintf(maxp,15,"%ld",php_sybase_module.max_persistent); - maxp[15]=0; + snprintf(maxp, 31, "%d/%ld", php_sybase_module.num_persistent, php_sybase_module.max_persistent); } + maxp[31]=0; + if (php_sybase_module.max_links==-1) { - strcpy(maxl,"Unlimited"); + snprintf(maxl, 31, "%d/unlimited", php_sybase_module.num_links ); } else { - snprintf(maxl,15,"%ld",php_sybase_module.max_links); - maxl[15]=0; - } - php_printf("<table cellpadding=5>" - "<tr><td>Allow persistent links:</td><td>%s</td></tr>\n" - "<tr><td>Persistent links:</td><td>%d/%s</td></tr>\n" - "<tr><td>Total links:</td><td>%d/%s</td></tr>\n" - "<tr><td>Application name:</td><td>%s</td></tr>\n" - "<tr><td valign=\"top\" width=\"20%%\">Client API information:</td><td><pre>%s</pre></td></tr>\n" - "</table>\n", - (php_sybase_module.allow_persistent?"Yes":"No"), - php_sybase_module.num_persistent,maxp, - php_sybase_module.num_links,maxl, - php_sybase_module.appname, - dbversion()); + snprintf(maxl, 31, "%d/%ld", php_sybase_module.num_links, php_sybase_module.max_links); + } + maxl[31]=0; + + php_info_print_table_start(); + php_info_print_table_row(2, "Sybase Support", "enabled"); + php_info_print_table_row(2, "Allow Persistent Links", (php_sybase_module.allow_persistent?"Yes":"No") ); + php_info_print_table_row(2, "Persistent Links", maxp); + php_info_print_table_row(2, "Total Links", maxl); + php_info_print_table_row(2, "Application Name", php_sybase_module.appname ); + php_info_print_table_row(2, "Client API Version", dbversion() ); + php_info_print_table_end(); + } diff --git a/ext/sybase_ct/php_sybase_ct.c b/ext/sybase_ct/php_sybase_ct.c index 08cd465dab..ec59097b0e 100644 --- a/ext/sybase_ct/php_sybase_ct.c +++ b/ext/sybase_ct/php_sybase_ct.c @@ -23,6 +23,7 @@ #include "php.h" #include "php_sybase_ct.h" #include "ext/standard/php_standard.h" +#include "ext/standard/info.h" #include "php_globals.h" #if HAVE_SYBASE_CT @@ -1512,30 +1513,30 @@ PHP_FUNCTION(sybase_affected_rows) PHP_MINFO_FUNCTION(sybase) { - char maxp[16],maxl[16]; + char maxp[32],maxl[32]; if (sybase_globals.max_persistent==-1) { - strcpy(maxp,"Unlimited"); + snprintf(maxp, 31, "%d/unlimited", sybase_globals.num_persistent); } else { - snprintf(maxp,15,"%ld",sybase_globals.max_persistent); - maxp[15]=0; + snprintf(maxp, 31, "%d/%ld", sybase_globals.num_persistent, sybase_globals.max_persistent); } + maxp[31]=0; + if (sybase_globals.max_links==-1) { - strcpy(maxl,"Unlimited"); + snprintf(maxl, 31, "%d/unlimited", sybase_globals.num_links); } else { - snprintf(maxl,15,"%ld",sybase_globals.max_links); - maxl[15]=0; - } - php_printf("<table cellpadding=5>" - "<tr><td>Allow persistent links:</td><td>%s</td></tr>\n" - "<tr><td>Persistent links:</td><td>%d/%s</td></tr>\n" - "<tr><td>Total links:</td><td>%d/%s</td></tr>\n" - "<tr><td>Application name:</td><td>%s</td></tr>\n" - "</table>\n", - (sybase_globals.allow_persistent?"Yes":"No"), - sybase_globals.num_persistent,maxp, - sybase_globals.num_links,maxl, - sybase_globals.appname); + snprintf(maxl, 31, "%d/%ld", sybase_globals.num_links, sybase_globals.max_links); + } + maxl[31]=0; + + php_info_print_table_start(); + php_info_print_table_row(2, "Sybase_CT Support", "enabled" ); + php_info_print_table_row(2, "Allow Persistent Links", (sybase_globals.allow_persistent?"yes":"no") ); + php_info_print_table_row(2, "Persistent Links", maxp ); + php_info_print_table_row(2, "Total Links", maxl ); + php_info_print_table_row(2, "Application Name", sybase_globals.appname ); + php_info_print_table_end(); + } |