Okay, so I've done some more tweaking and phpinfo()'s output should be
pretty much identical to the way it used to be in NS 4.x browsers, yet
still using some CSS to drop the file size down.  Not as much as a pure
CSS solution, but better.  Plus XHTML compliant.

I'll do the credits page shortly.

The only thing that isn't working now is the colouring of the highlight
colours on the info page.  I'm 99% sure I didn't break it, but maybe
it's related to what's going on with the zend highlighting code
(someone's working on that now, right?).

Jani/Derrick/et al ... is this okay with you now?

- Colin



Colin Viebrock wrote:
> cmv           Thu Sep 26 13:54:55 2002 EDT
> 
>   Modified files:              
>     /php4/ext/standard        css.c info.c 
>     /php4/main        php_ini.c 
>     /php4/sapi/aolserver      aolserver.c 
>     /php4/sapi/apache php_apache.c 
>   Log:
>   fix phpinfo() output for better browser BC
>   
>   
>   
> 
> 
> ------------------------------------------------------------------------
> 
> Index: php4/ext/standard/css.c
> diff -u php4/ext/standard/css.c:1.1 php4/ext/standard/css.c:1.2
> --- php4/ext/standard/css.c:1.1       Thu Sep 19 17:57:24 2002
> +++ php4/ext/standard/css.c   Thu Sep 26 13:54:53 2002
> @@ -16,7 +16,7 @@
>     +----------------------------------------------------------------------+
>  */
>  
> -/* $Id: css.c,v 1.1 2002/09/19 21:57:24 cmv Exp $ */
> +/* $Id: css.c,v 1.2 2002/09/26 17:54:53 cmv Exp $ */
>  
>  #include "php.h"
>  #include "info.h"
> @@ -28,78 +28,22 @@
>  {
>       TSRMLS_FETCH();
>  
> -     PUTS("body {");
> -     PUTS("background-color: #ffffff;");
> -     PUTS("color: #000000;");
> -     PUTS("font-family: verdana, arial, helvetica, sans-serif;");
> -     PUTS("}\n");
> -     PUTS("pre {");
> -     PUTS("font-family: \"andale mono\", \"monotype.com\", \"courier new\", 
>courier, monospace;");
> -     PUTS("}\n");
> -     PUTS("a[href] {");
> -     PUTS("color: #000099;");
> -     PUTS("text-decoration: none;");
> -     PUTS("}\n");
> -     PUTS("a[href]:hover {");
> -     PUTS("text-decoration: underline;");
> -     PUTS("}\n");
> -     PUTS("table {");
> -     PUTS("border-collapse: collapse;");
> -     PUTS("width: 600px;");
> -     PUTS("font-size: 80%;");
> -     PUTS("}\n");
> -     PUTS(".centered {");
> -     PUTS("text-align: center;");
> -     PUTS("}\n");
> -     PUTS(".centered table {");
> -     PUTS("margin-left: auto;");
> -     PUTS("margin-right: auto;");
> -     PUTS("text-align: left;");
> -     PUTS("}\n");
> -     PUTS("td, th {");
> -     PUTS("vertical-align: baseline;");
> -     PUTS("padding: 3px;");
> -     PUTS("border: 1px solid #000000;");
> -     PUTS("}\n");
> -     PUTS("h1 {");
> -     PUTS("text-align: center;");
> -     PUTS("font-size: 160%;");
> -     PUTS("}\n");
> -     PUTS(".phpver {");
> -     PUTS("text-align: left;");
> -     PUTS("}\n");
> -     PUTS("h2 {");
> -     PUTS("text-align: center;");
> -     PUTS("font-size: 130%;");
> -     PUTS("}\n");
> -     PUTS(".entry {");
> -     PUTS("background-color: #ccccff;");
> -     PUTS("font-weight: bold;");
> -     PUTS("}\n");
> -     PUTS(".header {");
> -     PUTS("background-color: #9999cc;");
> -     PUTS("font-weight: bold;");
> -     PUTS("margin-left: auto;");
> -     PUTS("margin-right: auto;");
> -     PUTS("}\n");
> -     PUTS(".value {");
> -     PUTS("background-color: #cccccc;");
> -     PUTS("margin-left: auto;");
> -     PUTS("margin-right: auto;");
> -     PUTS("}\n");
> -     PUTS(".infobox {");
> -     PUTS("background-color: #cccccc;");
> -     PUTS("}\n");
> -     PUTS("img {");
> -     PUTS("float: right;");
> -     PUTS("border: 0px;");
> -     PUTS("}\n");
> -     PUTS("hr {");
> -     PUTS("width: 600px;");
> -     PUTS("background-color: #cccccc;");
> -     PUTS("border: 0px;");
> -     PUTS("height: 1px;");
> -     PUTS("}\n");
> +     PUTS("body {background-color: #ffffff; color: #000000;}\n");
> +     PUTS("body, td, th, h1, h2 {font-family: arial, helvetica, sans-serif;}\n");
> +     PUTS("pre {margin: 0px; font-family: \"andale mono\", \"monotype.com\", 
>\"courier new\", courier, monospace;}\n");
> +     PUTS("a:link {color: #000099; text-decoration: none;}\n");
> +     PUTS("a:hover {text-decoration: underline;}\n");
> +     PUTS("table {border-collapse: collapse;}\n");
> +     PUTS("td, th { border: 1px solid #000000; font-size: 75%; vertical-align: 
>baseline;}\n");
> +     PUTS("h1 {font-size: 150%;}\n");
> +     PUTS(".p {text-align: left;}\n");
> +     PUTS("h2 {font-size: 125%;}\n");
> +     PUTS(".e {background-color: #ccccff; font-weight: bold;}\n");
> +     PUTS(".h {background-color: #9999cc; font-weight: bold;}\n");
> +     PUTS(".v {background-color: #cccccc;}\n");
> +     PUTS("i {color: #666666;}\n");
> +     PUTS("img {float: right; border: 0px;}\n");
> +     PUTS("hr {width: 600px; align: center; background-color: #cccccc; border: 0px; 
>height: 1px;}\n");
>  
>  }
>  /* }}} */
> Index: php4/ext/standard/info.c
> diff -u php4/ext/standard/info.c:1.204 php4/ext/standard/info.c:1.205
> --- php4/ext/standard/info.c:1.204    Thu Sep 19 17:57:24 2002
> +++ php4/ext/standard/info.c  Thu Sep 26 13:54:53 2002
> @@ -18,7 +18,7 @@
>     +----------------------------------------------------------------------+
>  */
>  
> -/* $Id: info.c,v 1.204 2002/09/19 21:57:24 cmv Exp $ */
> +/* $Id: info.c,v 1.205 2002/09/26 17:54:53 cmv Exp $ */
>  
>  #include "php.h"
>  #include "php_ini.h"
> @@ -51,7 +51,7 @@
>  #endif
>  
>  #define SECTION(name)        if (PG(html_errors)) { \
> -                                                     PUTS("<h2 class=\"section\">" 
>name "</h2>\n"); \
> +                                                     PUTS("<h2>" name "</h2>\n"); \
>                                               } else { \
>                                                       php_info_print_table_start(); \
>                                                       php_info_print_table_header(1, 
>name); \
> @@ -68,7 +68,7 @@
>  
>       if (show_info_func && module->info_func) {
>               if (PG(html_errors)) {
> -                     php_printf("<h2 class=\"section\"><a 
>name=\"module_%s\">%s</a></h2>\n", module->name, module->name);
> +                     php_printf("<h2><a name=\"module_%s\">%s</a></h2>\n", 
>module->name, module->name);
>               } else {
>                       php_info_print_table_start();
>                       php_info_print_table_header(1, module->name);
> @@ -105,7 +105,7 @@
>               while (zend_hash_get_current_data(Z_ARRVAL_PP(data), (void **) &tmp) 
>== SUCCESS) {
>                       if (PG(html_errors)) {
>                               PUTS("<tr>");
> -                             PUTS("<td class=\"entry\">");
> +                             PUTS("<td class=\"e\">");
>  
>                       }
>  
> @@ -126,7 +126,7 @@
>                       }
>                       PUTS("\"]");
>                       if (PG(html_errors)) {
> -                             PUTS("</td><td class=\"value\">");
> +                             PUTS("</td><td class=\"v\">");
>                       } else {
>                               PUTS(" => ");
>                       }
> @@ -143,14 +143,22 @@
>                               zval_copy_ctor(&tmp2);
>                               convert_to_string(&tmp2);
>                               if (PG(html_errors)) {
> -                                     zend_html_puts(Z_STRVAL(tmp2), Z_STRLEN(tmp2));
> +                                     if (Z_STRLEN(tmp2) == 0) {
> +                                             PUTS("<i>no value</i>");
> +                                     } else {
> +                                             zend_html_puts(Z_STRVAL(tmp2), 
>Z_STRLEN(tmp2));
> +                                     } 
>                               } else {
>                                       PUTS(Z_STRVAL(tmp2));
>                               }       
>                               zval_dtor(&tmp2);
>                       } else {
>                               if (PG(html_errors)) {
> -                                     zend_html_puts(Z_STRVAL_PP(tmp), 
>Z_STRLEN_PP(tmp));
> +                                     if (Z_STRLEN_PP(tmp) == 0) {
> +                                             PUTS("<i>no value</i>");
> +                                     } else {
> +                                             zend_html_puts(Z_STRVAL_PP(tmp), 
>Z_STRLEN_PP(tmp));
> +                                     }
>                               } else {
>                                       PUTS(Z_STRVAL_PP(tmp));
>                               }       
> @@ -294,8 +302,8 @@
>       }
>  
>       if (PG(html_errors)) {
> -             php_printf("<title>phpinfo()</title><meta http-equiv=\"Content-Type\" 
>content=\"text/html; charset=%s\" /></head>", charset);
> -             PUTS("<body>");
> +             php_printf("<title>phpinfo()</title><meta http-equiv=\"Content-Type\" 
>content=\"text/html; charset=%s\" /></head>\n", charset);
> +             PUTS("<body><center>\n");
>       } else {
>               PUTS("       _           _        __        ____  \n");
>               PUTS(" _ __ | |__  _ __ (_)_ __  / _| ___  / /\\ \\ \n");
> @@ -316,7 +324,7 @@
>               }
>  
>               if (expose_php && PG(html_errors)) {
> -                     PUTS("<a href=\"http://www.php.net/\";><img src=\"");
> +                     PUTS("<a href=\"http://www.php.net/\";><img border=\"0\" 
>src=\"");
>                       if (SG(request_info).request_uri) {
>                               PUTS(SG(request_info).request_uri);
>                       }
> @@ -328,7 +336,7 @@
>               }
>  
>               if (PG(html_errors)) {
> -                     php_printf("<h1 class=\"phpver\">PHP Version %s</h1>\n", 
>PHP_VERSION);
> +                     php_printf("<h1 class=\"p\">PHP Version %s</h1>\n", 
>PHP_VERSION);
>               } else {
>                       php_info_print_table_row(2, "PHP Version", PHP_VERSION);
>               }       
> @@ -406,7 +414,7 @@
>               /* Zend Engine */
>               php_info_print_box_start(0);
>               if (expose_php && PG(html_errors)) {
> -                     PUTS("<a href=\"http://www.zend.com/\";><img src=\"");
> +                     PUTS("<a href=\"http://www.zend.com/\";><img border=\"0\" 
>src=\"");
>                       if (SG(request_info).request_uri) {
>                               PUTS(SG(request_info).request_uri);
>                       }
> @@ -426,7 +434,7 @@
>                       PUTS(SG(request_info).request_uri);
>               }
>               PUTS("?=PHPB8B5F2A0-3C92-11d3-A3A9-4C7B08C10000\">");
> -             PUTS("PHP 4 Credits");
> +             PUTS("PHP Credits");
>               PUTS("</a></h1>\n");
>       }
>  
> @@ -451,6 +459,7 @@
>  
>               SECTION("Additional Modules");
>               php_info_print_table_start();
> +             php_info_print_table_header(1, "Module Name");
>               show_info_func = 0;
>               zend_hash_apply_with_argument(&module_registry, (apply_func_arg_t) 
>_display_module_info, &show_info_func TSRMLS_CC);
>               php_info_print_table_end();
> @@ -537,7 +546,7 @@
>               }
>       }
>       if (PG(html_errors)) {
> -             PUTS("</body></html>");
> +             PUTS("</center></body></html>");
>       }       
>  }
>  /* }}} */
> @@ -548,7 +557,7 @@
>       TSRMLS_FETCH();
>  
>       if (PG(html_errors)) {
> -             php_printf("<div class=\"centered\"><table><tbody>\n");
> +             php_printf("<table border=\"0\" cellpadding=\"3\" width=\"600\">\n");
>       } else {
>               php_printf("\n");
>       }       
> @@ -559,7 +568,7 @@
>       TSRMLS_FETCH();
>  
>       if (PG(html_errors)) {
> -             php_printf("</tbody></table></div><br />\n");
> +             php_printf("</table><br />\n");
>       }
>  
>  }
> @@ -571,11 +580,11 @@
>       php_info_print_table_start();
>       if (flag) {
>               if (PG(html_errors)) {
> -                     php_printf("<tr class=\"header\"><td>\n");
> +                     php_printf("<tr class=\"h\"><td>\n");
>               }
>       } else {
>               if (PG(html_errors)) {
> -                     php_printf("<tr class=\"infobox\"><td>\n");
> +                     php_printf("<tr class=\"v\"><td>\n");
>               } else {
>                       php_printf("\n");
>               }       
> @@ -610,7 +619,7 @@
>       TSRMLS_FETCH();
>       
>       if (PG(html_errors)) {
> -             php_printf("<tr class=\"header\"><th colspan=\"%d\">%s</th></tr>\n", 
>num_cols, header );
> +             php_printf("<tr class=\"h\"><th colspan=\"%d\">%s</th></tr>\n", 
>num_cols, header );
>       } else {
>               spaces = (74 - strlen(header));
>               php_printf("%*s%s%*s\n", (int)(spaces/2), " ", header, 
>(int)(spaces/2), " ");
> @@ -629,7 +638,7 @@
>  
>       va_start(row_elements, num_cols);
>       if (PG(html_errors)) {
> -             php_printf("<tr class=\"header\">");
> +             php_printf("<tr class=\"h\">");
>       }       
>       for (i=0; i<num_cols; i++) {
>               row_element = va_arg(row_elements, char *);
> @@ -672,12 +681,16 @@
>       for (i=0; i<num_cols; i++) {
>               if (PG(html_errors)) {
>                       php_printf("<td class=\"%s\">",
> -                        (i==0 ? "entry" : "value" )
> +                        (i==0 ? "e" : "v" )
>                       );
>               }       
>               row_element = va_arg(row_elements, char *);
>               if (!row_element || !*row_element) {
> -                     PUTS( " " );
> +                     if (PG(html_errors)) {
> +                             PUTS( "<i>no value</i>" );
> +                     } else {
> +                             PUTS( " " );
> +                     }
>               } else {
>                       if (PG(html_errors)) {
>                               zend_html_puts(row_element,  strlen(row_element));
> @@ -691,7 +704,7 @@
>                       }
>               }
>               if (PG(html_errors)) {
> -                     php_printf("</td>");
> +                     php_printf(" </td>");
>               }       
>       }
>       if (PG(html_errors)) {
> Index: php4/main/php_ini.c
> diff -u php4/main/php_ini.c:1.102 php4/main/php_ini.c:1.103
> --- php4/main/php_ini.c:1.102 Mon Sep 23 08:10:07 2002
> +++ php4/main/php_ini.c       Thu Sep 26 13:54:53 2002
> @@ -16,7 +16,7 @@
>     +----------------------------------------------------------------------+
>   */
>  
> -/* $Id: php_ini.c,v 1.102 2002/09/23 12:10:07 zeev Exp $ */
> +/* $Id: php_ini.c,v 1.103 2002/09/26 17:54:53 cmv Exp $ */
>  
>  /* Check CWD for php.ini */
>  #define INI_CHECK_CWD
> @@ -101,11 +101,11 @@
>       }
>       if (PG(html_errors)) {
>               PUTS("<tr>");
> -             PUTS("<td class=\"entry\">");
> +             PUTS("<td class=\"e\">");
>               PHPWRITE(ini_entry->name, ini_entry->name_length-1);
> -             PUTS("</td><td class=\"value\">");
> +             PUTS("</td><td class=\"v\">");
>               php_ini_displayer_cb(ini_entry, ZEND_INI_DISPLAY_ACTIVE);
> -             PUTS("</td><td class=\"value\">");
> +             PUTS("</td><td class=\"v\">");
>               php_ini_displayer_cb(ini_entry, ZEND_INI_DISPLAY_ORIG);
>               PUTS("</td></tr>\n");
>       } else {
> Index: php4/sapi/aolserver/aolserver.c
> diff -u php4/sapi/aolserver/aolserver.c:1.71 php4/sapi/aolserver/aolserver.c:1.72
> --- php4/sapi/aolserver/aolserver.c:1.71      Thu Sep 19 17:57:24 2002
> +++ php4/sapi/aolserver/aolserver.c   Thu Sep 26 13:54:53 2002
> @@ -22,7 +22,7 @@
>   * - CGI/1.1 conformance
>   */
>  
> -/* $Id: aolserver.c,v 1.71 2002/09/19 21:57:24 cmv Exp $ */
> +/* $Id: aolserver.c,v 1.72 2002/09/26 17:54:53 cmv Exp $ */
>  
>  /* conflict between PHP and AOLserver headers */
>  #define Debug php_Debug
> @@ -36,7 +36,7 @@
>  #endif
>  
>  #include "ext/standard/info.h"
> -#define SECTION(name)  PUTS("<h2 class=\"section\">" name "</h2>\n")
> +#define SECTION(name)  PUTS("<h2>" name "</h2>\n")
>  
>  #define NS_BUF_SIZE 511
>  
> @@ -205,7 +205,7 @@
>       int i;
>       
>       php_info_print_table_start();
> -     php_info_print_table_row(2, "SAPI module version", "$Id: aolserver.c,v 1.71 
>2002/09/19 21:57:24 cmv Exp $");
> +     php_info_print_table_row(2, "SAPI module version", "$Id: aolserver.c,v 1.72 
>2002/09/26 17:54:53 cmv Exp $");
>       php_info_print_table_row(2, "Build date", Ns_InfoBuildDate());
>       php_info_print_table_row(2, "Config file path", Ns_InfoConfigFile());
>       php_info_print_table_row(2, "Error Log path", Ns_InfoErrorLog());
> Index: php4/sapi/apache/php_apache.c
> diff -u php4/sapi/apache/php_apache.c:1.67 php4/sapi/apache/php_apache.c:1.68
> --- php4/sapi/apache/php_apache.c:1.67        Thu Sep 19 17:57:25 2002
> +++ php4/sapi/apache/php_apache.c     Thu Sep 26 13:54:54 2002
> @@ -17,7 +17,7 @@
>     |          David Sklar <[EMAIL PROTECTED]>                             |
>     +----------------------------------------------------------------------+
>   */
> -/* $Id: php_apache.c,v 1.67 2002/09/19 21:57:25 cmv Exp $ */
> +/* $Id: php_apache.c,v 1.68 2002/09/26 17:54:54 cmv Exp $ */
>  
>  #include "php_apache_http.h"
>  
> @@ -34,7 +34,7 @@
>  php_apache_info_struct php_apache_info;
>  #endif
>  
> -#define SECTION(name)  PUTS("<h2 class=\"section\">" name "</h2>\n")
> +#define SECTION(name)  PUTS("<h2>" name "</h2>\n")
>  
>  extern module *top_module;
>  



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to