]> granicus.if.org Git - php/commitdiff
more prettiness
authorColin Viebrock <cmv@php.net>
Fri, 7 Apr 2000 16:41:19 +0000 (16:41 +0000)
committerColin Viebrock <cmv@php.net>
Fri, 7 Apr 2000 16:41:19 +0000 (16:41 +0000)
ext/standard/info.c
ext/standard/info.h
sapi/apache/php_apache.c

index 46084dba924ad03cfcc72a8eab1ebfcb282d6555..b7e900821e403125abce60f57a533f835175f231 100644 (file)
@@ -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("<TR VALIGN=\"bottom\" bgcolor=\"" PHP_HEADER_COLOR "\">");
-               PUTS("<TH COLSPAN=2>PHP 4.0 Authors<BR></TH></TR>\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("<TR VALIGN=\"bottom\" bgcolor=\"" PHP_HEADER_COLOR "\">");
-               PUTS("<TH COLSPAN=2>SAPI Module<BR></TH></TR>\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("<TR VALIGN=\"bottom\" bgcolor=\"" PHP_HEADER_COLOR "\">");
-               PUTS("<TH COLSPAN=2>Module Authors<BR></TH></TR>\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("<HR NOSHADE SIZE=1 WIDTH=600>\n");
 }
 
+PHPAPI void php_info_print_table_colspan_header(int num_cols, char *header)
+{
+       php_printf("<TR BGCOLOR=\"" PHP_HEADER_COLOR "\"><TH COLSPAN=%d>%s</TH></TR>\n", num_cols, header );
+}
 
 
 PHPAPI void php_info_print_table_header(int num_cols, ...)
index 3094585b1a773f52c57b63ddd7e4f54b0cb2265d..42b79ac575dc55f7097a962fa22f589dad32155c 100644 (file)
@@ -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);
index 4ca8a2de3e890bd47601ef5547142c9d2ef105ae..d9b3a1df7858c14553f5906ba04e6f69c43b63ff 100644 (file)
@@ -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("<table border=5 width=\"600\">\n");
-    php_info_print_table_header(2, "Entry", "Value");
 #if WIN32|WINNT
        PUTS("Apache for Windows 95/NT<br>");
+       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<br>keep alive: %s<br>max per connection: %d",max_requests_per_child,serv->keep_alive ? "on":"off", serv->keep_alive_max);
+       sprintf(output_buf, "Per Child: %d<br>Keep Alive: %s<br>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<br>keep-alive: %d",serv->timeout,serv->keep_alive_timeout);
+       sprintf(output_buf, "Connection: %d<br>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("<tr><td valign=\"top\" bgcolor=\"" PHP_ENTRY_NAME_COLOR "\">Loaded modules</td><td bgcolor=\"" PHP_CONTENTS_COLOR "\">");
        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("</td></tr>\n");
-       PUTS("</table>\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("<table border=5 width=\"600\">\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("</table>\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("<table border=5 width=\"600\">\n");
-               PUTS(" <tr><th colspan=2 bgcolor=\"" PHP_HEADER_COLOR "\">HTTP Request Headers</th></tr>\n");
+               php_info_print_table_start();   
+               PUTS("<TR BGCOLOR=\"" PHP_HEADER_COLOR "\"><TH COLSPAN=2>HTTP Request Headers</TH></TR>\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(" <tr><th colspan=2  bgcolor=\"" PHP_HEADER_COLOR "\">HTTP Response Headers</th></tr>\n");
+               PUTS("<TR BGCOLOR=\"" PHP_HEADER_COLOR "\"><TH COLSPAN=2>HTTP Response Headers</TH></TR>\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("</table>\n\n");
+               php_info_print_table_end();
        }
 
 }