From: Colin Viebrock Date: Fri, 7 Apr 2000 16:41:19 +0000 (+0000) Subject: more prettiness X-Git-Tag: php-4.0RC2~448 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5628b3f0abd51cd1facd5bbd0f5a68691c5c87e1;p=php more prettiness --- diff --git a/ext/standard/info.c b/ext/standard/info.c index 46084dba92..b7e900821e 100644 --- a/ext/standard/info.c +++ b/ext/standard/info.c @@ -174,15 +174,15 @@ PHPAPI void php_print_info(int flag) php_info_print_table_row(2, "php.ini Path", CONFIGURATION_FILE_PATH ); #if ZEND_DEBUG - php_info_print_table_row(2, "ZEND_DEBUG", "Enabled" ); + php_info_print_table_row(2, "ZEND_DEBUG", "enabled" ); #else - php_info_print_table_row(2, "ZEND_DEBUG", "Disabled" ); + php_info_print_table_row(2, "ZEND_DEBUG", "disabled" ); #endif #ifdef ZTS - php_info_print_table_row(2, "Thread Safety", "Enabled" ); + php_info_print_table_row(2, "Thread Safety", "enabled" ); #else - php_info_print_table_row(2, "Thread Safety", "Disabled" ); + php_info_print_table_row(2, "Thread Safety", "disabled" ); #endif php_info_print_table_end(); @@ -326,8 +326,7 @@ void php_print_credits(int flag) /* Language */ php_info_print_table_start(); - PUTS(""); - PUTS("PHP 4.0 Authors
\n"); + php_info_print_table_colspan_header(2, "PHP 4.0 Authors"); php_info_print_table_header(2, "Contribution", "Authors"); CREDIT_LINE("Zend Scripting Language Engine", "Andi Gutmans, Zeev Suraski"); CREDIT_LINE("Extension Module API", "Andi Gutmans, Zeev Suraski"); @@ -341,8 +340,7 @@ void php_print_credits(int flag) /* SAPI Modules */ php_info_print_table_start(); - PUTS(""); - PUTS("SAPI Module
\n"); + php_info_print_table_colspan_header(2, "SAPI Module"); php_info_print_table_header(2, "Contribution", "Authors"); CREDIT_LINE("Apache", "Rasmus Lerdorf, Zeev Suraski"); CREDIT_LINE("ISAPI", "Andi Gutmans, Zeev Suraski"); @@ -358,8 +356,7 @@ void php_print_credits(int flag) /* Modules */ php_info_print_table_start(); - PUTS(""); - PUTS("Module Authors
\n"); + php_info_print_table_colspan_header(2, "Module Authors"); php_info_print_table_header(2, "Module", "Authors"); CREDIT_LINE("Apache", "Rasmus Lerdorf, Stig Bakken, David Sklar"); CREDIT_LINE("Assert", "Thies C. Arntzen"); @@ -449,6 +446,10 @@ PHPAPI void php_info_print_hr() php_printf("
\n"); } +PHPAPI void php_info_print_table_colspan_header(int num_cols, char *header) +{ + php_printf("%s\n", num_cols, header ); +} PHPAPI void php_info_print_table_header(int num_cols, ...) diff --git a/ext/standard/info.h b/ext/standard/info.h index 3094585b1a..42b79ac575 100644 --- a/ext/standard/info.h +++ b/ext/standard/info.h @@ -65,6 +65,7 @@ PHP_FUNCTION(zend_logo_guid); PHPAPI void php_print_info(int flag); PHPAPI void php_print_credits(int flag); PHPAPI void php_print_style(void); +PHPAPI void php_info_print_table_colspan_header(int num_cols, char *header); PHPAPI void php_info_print_table_header(int num_cols, ...); PHPAPI void php_info_print_table_row(int num_cols, ...); PHPAPI void php_info_print_table_start(void); diff --git a/sapi/apache/php_apache.c b/sapi/apache/php_apache.c index 4ca8a2de3e..d9b3a1df78 100644 --- a/sapi/apache/php_apache.c +++ b/sapi/apache/php_apache.c @@ -155,6 +155,7 @@ PHP_MINFO_FUNCTION(apache) char output_buf[128]; #if !defined(WIN32) && !defined(WINNT) char name[64]; + char modulenames[1024]; char *p; #endif server_rec *serv; @@ -167,15 +168,17 @@ PHP_MINFO_FUNCTION(apache) serv = ((request_rec *) SG(server_context))->server; - PUTS("\n"); - php_info_print_table_header(2, "Entry", "Value"); #if WIN32|WINNT PUTS("Apache for Windows 95/NT
"); + php_info_print_table_start(); #else + php_info_print_table_start(); php_info_print_table_row(2, "APACHE_INCLUDE", PHP_APACHE_INCLUDE); php_info_print_table_row(2, "APACHE_TARGET", PHP_APACHE_TARGET); #endif + php_info_print_table_row(2, "Apache Version", SERVER_VERSION); + #ifdef APACHE_RELEASE sprintf(output_buf, "%d", APACHE_RELEASE); php_info_print_table_row(2, "Apache Release", output_buf); @@ -183,33 +186,33 @@ PHP_MINFO_FUNCTION(apache) sprintf(output_buf, "%d", MODULE_MAGIC_NUMBER); php_info_print_table_row(2, "Apache API Version", output_buf); sprintf(output_buf, "%s:%u", serv->server_hostname,serv->port); - php_info_print_table_row(2, "Hostname/Port", output_buf); + php_info_print_table_row(2, "Hostname:Port", output_buf); #if !defined(WIN32) && !defined(WINNT) sprintf(output_buf, "%s(%d)/%d", user_name,(int)user_id,(int)group_id); php_info_print_table_row(2, "User/Group", output_buf); - sprintf(output_buf, "per child: %d
keep alive: %s
max per connection: %d",max_requests_per_child,serv->keep_alive ? "on":"off", serv->keep_alive_max); + sprintf(output_buf, "Per Child: %d
Keep Alive: %s
Max Per Connection: %d",max_requests_per_child,serv->keep_alive ? "on":"off", serv->keep_alive_max); php_info_print_table_row(2, "Max Requests", output_buf); #endif - sprintf(output_buf, "connection: %d
keep-alive: %d",serv->timeout,serv->keep_alive_timeout); + sprintf(output_buf, "Connection: %d
Keep-Alive: %d",serv->timeout,serv->keep_alive_timeout); php_info_print_table_row(2, "Timeouts", output_buf); #if !defined(WIN32) && !defined(WINNT) php_info_print_table_row(2, "Server Root", server_root); - - PUTS("\n"); - PUTS("
Loaded modules"); for(modp = top_module; modp; modp = modp->next) { strlcpy(name, modp->name, sizeof(name)); if ((p = strrchr(name, '.'))) { *p='\0'; /* Cut off ugly .c extensions on module names */ } + strcpy(modulenames, name); PUTS(name); if (modp->next) { - PUTS(", "); + strcpy(modulenames, ", "); } } + php_info_print_table_row(2, "Loaded Modules", modulenames); #endif - PUTS("
\n"); + + php_info_print_table_end(); { @@ -223,13 +226,13 @@ PHP_MINFO_FUNCTION(apache) arr = table_elts(r->subprocess_env); elts = (table_entry *)arr->elts; - SECTION("Apache Environment"); - PUTS("\n"); + SECTION("Apache Environment"); + php_info_print_table_start(); php_info_print_table_header(2, "Variable", "Value"); for (i=0; i < arr->nelts; i++) { php_info_print_table_row(2, elts[i].key, elts[i].val); } - PUTS("
\n"); + php_info_print_table_end(); } { @@ -241,8 +244,8 @@ PHP_MINFO_FUNCTION(apache) r = ((request_rec *) SG(server_context)); SECTION("HTTP Headers Information"); - PUTS("\n"); - PUTS(" \n"); + php_info_print_table_start(); + PUTS("\n"); php_info_print_table_row(2, "HTTP Request", r->the_request); env_arr = table_elts(r->headers_in); env = (table_entry *)env_arr->elts; @@ -251,7 +254,7 @@ PHP_MINFO_FUNCTION(apache) php_info_print_table_row(2, env[i].key, env[i].val); } } - PUTS(" \n"); + PUTS("\n"); env_arr = table_elts(r->headers_out); env = (table_entry *)env_arr->elts; for(i = 0; i < env_arr->nelts; ++i) { @@ -259,7 +262,7 @@ PHP_MINFO_FUNCTION(apache) php_info_print_table_row(2, env[i].key, env[i].val); } } - PUTS("
HTTP Request Headers
HTTP Request Headers
HTTP Response Headers
HTTP Response Headers
\n\n"); + php_info_print_table_end(); } }