mirror of
https://github.com/php/php-src.git
synced 2024-11-24 10:24:11 +08:00
phpinfo() prettying
This commit is contained in:
parent
56fc855afd
commit
a7c8bfb9fb
@ -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) );
|
||||
|
@ -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();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -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();
|
||||
|
||||
}
|
||||
|
||||
/* }}} */
|
||||
|
@ -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 )
|
||||
|
@ -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)
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
|
||||
|
@ -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();
|
||||
}
|
||||
|
@ -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();
|
||||
|
||||
}
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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();
|
||||
}
|
||||
|
@ -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:
|
||||
*/
|
||||
*/
|
||||
|
@ -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;
|
||||
snprintf(maxl, 31, "%d/%ld", php_sybase_module.num_links, php_sybase_module.max_links);
|
||||
}
|
||||
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());
|
||||
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();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -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;
|
||||
snprintf(maxl, 31, "%d/%ld", sybase_globals.num_links, sybase_globals.max_links);
|
||||
}
|
||||
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);
|
||||
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();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user