php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #63263
Patch refactorphpinfo revision 2012-10-11 14:18 UTC by pascal dot chevrel at free dot fr

Patch refactorphpinfo for PHP options/info functions Bug #63263

Patch version 2012-10-11 14:18 UTC

Return to Bug #63263 | Download this patch
Patch Revisions:

Developer: pascal.chevrel@free.fr

diff --git a/ext/standard/css.c b/ext/standard/css.c
index 17588c2..5bb49c0 100644
--- a/ext/standard/css.c
+++ b/ext/standard/css.c
@@ -23,25 +23,20 @@
 
 PHPAPI void php_info_print_css(TSRMLS_D) /* {{{ */
 {
-	PUTS("body {background-color: #ffffff; color: #000000;}\n");
-	PUTS("body, td, th, h1, h2 {font-family: sans-serif;}\n");
-	PUTS("pre {margin: 0px; font-family: monospace;}\n");
+	PUTS("body {background-color: #ffffff; color: #000000; font-family: sans-serif;}\n");
+	PUTS("pre {margin: 0; font-family: monospace;}\n");
 	PUTS("a:link {color: #000099; text-decoration: none; background-color: #ffffff;}\n");
 	PUTS("a:hover {text-decoration: underline;}\n");
-	PUTS("table {border-collapse: collapse;}\n");
-	PUTS(".center {text-align: center;}\n");
-	PUTS(".center table { margin-left: auto; margin-right: auto; text-align: left;}\n");
-	PUTS(".center th { text-align: center !important; }\n");
-	PUTS("td, th { border: 1px solid #000000; font-size: 75%; vertical-align: baseline;}\n");
-	PUTS("h1 {font-size: 150%;}\n");
-	PUTS("h2 {font-size: 125%;}\n");
-	PUTS(".p {text-align: left;}\n");
- 	PUTS(".e {background-color: #ccccff; font-weight: bold; color: #000000;}\n");
- 	PUTS(".h {background-color: #9999cc; font-weight: bold; color: #000000;}\n");
- 	PUTS(".v {background-color: #cccccc; color: #000000;}\n");
-	PUTS(".vr {background-color: #cccccc; text-align: right; color: #000000;}\n");
-	PUTS("img {float: right; border: 0px;}\n");
-	PUTS("hr {width: 600px; background-color: #cccccc; border: 0px; height: 1px; color: #000000;}\n");
+	PUTS("table {border-collapse: collapse; margin:0 auto 1em auto; width: 600px; }\n");
+	PUTS("table h1 { text-align:left; }\n");
+	PUTS("td, th { border: 1px solid #000000; font-size: 75%; vertical-align: baseline; text-align:left;padding:3px; }\n");
+	PUTS("h1 {font-size: 150%; text-align:center;}\n");
+	PUTS("h2 {font-size: 125%; text-align:center;}\n");
+ 	PUTS("tr.h th, tr.h td {background-color: #9999cc; }\n");
+ 	PUTS("th {background-color: #CCCCFF;}\n");
+ 	PUTS("td {background-color: #cccccc;}\n");
+	PUTS("img {float: right; border: 0;}\n");
+	PUTS("hr {width: 600px; background-color: #cccccc; border: 0; height: 1px; color: #000000;}\n");
 }
 /* }}} */
 
diff --git a/ext/standard/info.c b/ext/standard/info.c
index beb1477..c0e6c80 100644
--- a/ext/standard/info.c
+++ b/ext/standard/info.c
@@ -109,7 +109,7 @@ static void php_info_print_stream_hash(const char *name, HashTable *ht TSRMLS_DC
 			HashPosition pos;
 
 			if (!sapi_module.phpinfo_as_text) {
-				php_info_printf("<tr><td class=\"e\">Registered %s</td><td class=\"v\">", name);
+				php_info_printf("<tr><th>Registered %s</th><td>", name);
 			} else {
 				php_info_printf("\nRegistered %s => ", name);
 			}
@@ -203,7 +203,7 @@ static void php_print_gpcse_array(char *name, uint name_length TSRMLS_DC)
 		while (zend_hash_get_current_data(Z_ARRVAL_PP(data), (void **) &tmp) == SUCCESS) {
 			if (!sapi_module.phpinfo_as_text) {
 				php_info_print("<tr>");
-				php_info_print("<td class=\"e\">");
+				php_info_print("<th>");
 			}
 
 			php_info_print(name);
@@ -223,7 +223,7 @@ static void php_print_gpcse_array(char *name, uint name_length TSRMLS_DC)
 			}
 			php_info_print("\"]");
 			if (!sapi_module.phpinfo_as_text) {
-				php_info_print("</td><td class=\"v\">");
+				php_info_print("</th><td>");
 			} else {
 				php_info_print(" => ");
 			}
@@ -272,7 +272,7 @@ static void php_print_gpcse_array(char *name, uint name_length TSRMLS_DC)
  */
 void php_info_print_style(TSRMLS_D)
 {
-	php_info_printf("<style type=\"text/css\">\n");
+	php_info_printf("<style>\n");
 	php_info_print_css(TSRMLS_C);
 	php_info_printf("</style>\n");
 }
@@ -624,14 +624,14 @@ PHPAPI char *php_get_uname(char mode)
  */
 PHPAPI void php_print_info_htmlhead(TSRMLS_D)
 {
-	php_info_print("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"DTD/xhtml1-transitional.dtd\">\n");
-	php_info_print("<html xmlns=\"http://www.w3.org/1999/xhtml\">");
+	php_info_print("<!DOCTYPE html>\n");
+	php_info_print("<html>");
 	php_info_print("<head>\n");
 	php_info_print_style(TSRMLS_C);
 	php_info_print("<title>phpinfo()</title>");
 	php_info_print("<meta name=\"ROBOTS\" content=\"NOINDEX,NOFOLLOW,NOARCHIVE\" />");
 	php_info_print("</head>\n");
-	php_info_print("<body><div class=\"center\">\n");
+	php_info_print("<body>\n");
 }
 /* }}} */
 
@@ -685,7 +685,7 @@ PHPAPI void php_print_info(int flag TSRMLS_DC)
 		}
 
 		if (!sapi_module.phpinfo_as_text) {
-			php_info_printf("<h1 class=\"p\">PHP Version %s</h1>\n", PHP_VERSION);
+			php_info_printf("<h1>PHP Version %s</h1>\n", PHP_VERSION);
 		} else {
 			php_info_print_table_row(2, "PHP Version", PHP_VERSION);
 		}	
@@ -919,7 +919,7 @@ PHPAPI void php_print_info(int flag TSRMLS_DC)
 	}
 
 	if (!sapi_module.phpinfo_as_text) {
-		php_info_print("</div></body></html>");
+		php_info_print("</body></html>");
 	}	
 }
 /* }}} */
@@ -927,7 +927,7 @@ PHPAPI void php_print_info(int flag TSRMLS_DC)
 PHPAPI void php_info_print_table_start(void) /* {{{ */
 {
 	if (!sapi_module.phpinfo_as_text) {
-		php_info_print("<table border=\"0\" cellpadding=\"3\" width=\"600\">\n");
+		php_info_print("<table>\n");
 	} else {
 		php_info_print("\n");
 	}	
@@ -937,7 +937,7 @@ PHPAPI void php_info_print_table_start(void) /* {{{ */
 PHPAPI void php_info_print_table_end(void) /* {{{ */
 {
 	if (!sapi_module.phpinfo_as_text) {
-		php_info_print("</table><br />\n");
+		php_info_print("</table>\n");
 	}
 
 }
@@ -1033,7 +1033,7 @@ PHPAPI void php_info_print_table_header(int num_cols, ...)
 /* {{{ php_info_print_table_row_internal
  */
 static void php_info_print_table_row_internal(int num_cols, 
-		const char *value_class, va_list row_elements)
+		va_list row_elements)
 {
 	int i;
 	char *row_element;
@@ -1043,9 +1043,7 @@ static void php_info_print_table_row_internal(int num_cols,
 	}	
 	for (i=0; i<num_cols; i++) {
 		if (!sapi_module.phpinfo_as_text) {
-			php_info_printf("<td class=\"%s\">",
-			   (i==0 ? "e" : value_class )
-			);
+			php_info_printf("<%s>", (i==0 ? "th" : "td" ) );
 		}	
 		row_element = va_arg(row_elements, char *);
 		if (!row_element || !*row_element) {
@@ -1065,7 +1063,7 @@ static void php_info_print_table_row_internal(int num_cols,
 			}
 		}
 		if (!sapi_module.phpinfo_as_text) {
-			php_info_print(" </td>");
+			php_info_printf("</%s>", (i==0 ? "th" : "td" ) );
 		} else if (i == (num_cols - 1)) {
 			php_info_print("\n");
 		}
@@ -1083,7 +1081,7 @@ PHPAPI void php_info_print_table_row(int num_cols, ...)
 	va_list row_elements;
 	
 	va_start(row_elements, num_cols);
-	php_info_print_table_row_internal(num_cols, "v", row_elements);
+	php_info_print_table_row_internal(num_cols, row_elements);
 	va_end(row_elements);
 }
 /* }}} */
@@ -1096,7 +1094,7 @@ PHPAPI void php_info_print_table_row_ex(int num_cols, const char *value_class,
 	va_list row_elements;
 	
 	va_start(row_elements, value_class);
-	php_info_print_table_row_internal(num_cols, value_class, row_elements);
+	php_info_print_table_row_internal(num_cols, row_elements);
 	va_end(row_elements);
 }
 /* }}} */
diff --git a/main/php_ini.c b/main/php_ini.c
index 89a3d7e..c22fbe2 100644
--- a/main/php_ini.c
+++ b/main/php_ini.c
@@ -128,11 +128,11 @@ static int php_ini_displayer(zend_ini_entry *ini_entry, int module_number TSRMLS
 	}
 	if (!sapi_module.phpinfo_as_text) {
 		PUTS("<tr>");
-		PUTS("<td class=\"e\">");
+		PUTS("<th>");
 		PHPWRITE(ini_entry->name, ini_entry->name_length - 1);
-		PUTS("</td><td class=\"v\">");
+		PUTS("</th><td>");
 		php_ini_displayer_cb(ini_entry, ZEND_INI_DISPLAY_ACTIVE TSRMLS_CC);
-		PUTS("</td><td class=\"v\">");
+		PUTS("</td><td>");
 		php_ini_displayer_cb(ini_entry, ZEND_INI_DISPLAY_ORIG TSRMLS_CC);
 		PUTS("</td></tr>\n");
 	} else {
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 17:01:32 2024 UTC