summaryrefslogtreecommitdiff
path: root/ext/standard/info.c
diff options
context:
space:
mode:
authorColin Viebrock <colin@viebrock.ca>2012-11-08 12:08:45 -0600
committerColin Viebrock <colin@viebrock.ca>2012-11-08 12:08:45 -0600
commitff93287fff44ad31d8e0bc9d5ea945719b0d40b0 (patch)
tree92463174ef27a82bad77f3af43fb168ef181c677 /ext/standard/info.c
parente383d4d20ddeb908569c5ad8cd4772c738f2db99 (diff)
downloadphp-git-ff93287fff44ad31d8e0bc9d5ea945719b0d40b0.tar.gz
Bringing CSS up to this decade's standards.
Here are some tweaks to the phpinfo() styling, since this really hasn't been touched in almost a decade: - color codes are shortened - table width is bigger and handled via CSS - fix so that long INI entries don't make the layout super wide - bgcolor for "Additional Modules" wasn't set - fix my email address Signed-off-by: Colin Viebrock <colin@viebrock.ca>
Diffstat (limited to 'ext/standard/info.c')
-rw-r--r--ext/standard/info.c68
1 files changed, 34 insertions, 34 deletions
diff --git a/ext/standard/info.c b/ext/standard/info.c
index beb147797d..cbc8606e1e 100644
--- a/ext/standard/info.c
+++ b/ext/standard/info.c
@@ -1,4 +1,4 @@
-/*
+/*
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
@@ -14,7 +14,7 @@
+----------------------------------------------------------------------+
| Authors: Rasmus Lerdorf <rasmus@php.net> |
| Zeev Suraski <zeev@zend.com> |
- | Colin Viebrock <colin@easydns.com> |
+ | Colin Viebrock <colin@viebrock.ca> |
+----------------------------------------------------------------------+
*/
@@ -67,7 +67,7 @@ static int php_info_print_html_esc(const char *str, int len) /* {{{ */
int written;
char *new_str;
TSRMLS_FETCH();
-
+
new_str = php_escape_html_entities((unsigned char *) str, len, &new_len, 0, ENT_QUOTES, "utf-8" TSRMLS_CC);
written = php_output_write(new_str, new_len TSRMLS_CC);
efree(new_str);
@@ -81,11 +81,11 @@ static int php_info_printf(const char *fmt, ...) /* {{{ */
int len, written;
va_list argv;
TSRMLS_FETCH();
-
+
va_start(argv, fmt);
len = vspprintf(&buf, 0, fmt, argv);
va_end(argv);
-
+
written = php_output_write(buf, len TSRMLS_CC);
efree(buf);
return written;
@@ -103,7 +103,7 @@ static void php_info_print_stream_hash(const char *name, HashTable *ht TSRMLS_DC
{
char *key;
uint len;
-
+
if (ht) {
if (zend_hash_num_elements(ht)) {
HashPosition pos;
@@ -113,7 +113,7 @@ static void php_info_print_stream_hash(const char *name, HashTable *ht TSRMLS_DC
} else {
php_info_printf("\nRegistered %s => ", name);
}
-
+
zend_hash_internal_pointer_reset_ex(ht, &pos);
while (zend_hash_get_current_key_ex(ht, &key, &len, NULL, 0, &pos) == HASH_KEY_IS_STRING)
{
@@ -125,7 +125,7 @@ static void php_info_print_stream_hash(const char *name, HashTable *ht TSRMLS_DC
break;
}
}
-
+
if (!sapi_module.phpinfo_as_text) {
php_info_print("</td></tr>\n");
}
@@ -160,10 +160,10 @@ PHPAPI void php_info_print_module(zend_module_entry *zend_module TSRMLS_DC) /* {
}
} else {
if (!sapi_module.phpinfo_as_text) {
- php_info_printf("<tr><td>%s</td></tr>\n", zend_module->name);
+ php_info_printf("<tr><td class=\"v\">%s</td></tr>\n", zend_module->name);
} else {
php_info_printf("%s\n", zend_module->name);
- }
+ }
}
}
/* }}} */
@@ -208,7 +208,7 @@ static void php_print_gpcse_array(char *name, uint name_length TSRMLS_DC)
php_info_print(name);
php_info_print("[\"");
-
+
switch (zend_hash_get_current_key_ex(Z_ARRVAL_PP(data), &string_key, &string_len, &num_key, 0, NULL)) {
case HASH_KEY_IS_STRING:
if (!sapi_module.phpinfo_as_text) {
@@ -432,7 +432,7 @@ char* php_get_windows_name()
sub = "Web Edition";
else sub = "Standard Edition";
}
- }
+ }
}
if ( osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 1 ) {
@@ -525,7 +525,7 @@ PHPAPI char *php_get_uname(char mode)
DWORD dwWindowsMinorVersion = (DWORD)(HIBYTE(LOWORD(dwVersion)));
DWORD dwSize = MAX_COMPUTERNAME_LENGTH + 1;
char ComputerName[MAX_COMPUTERNAME_LENGTH + 1];
-
+
GetComputerName(ComputerName, &dwSize);
if (mode == 's') {
@@ -574,7 +574,7 @@ PHPAPI char *php_get_uname(char mode)
if (mode == 's') {
php_uname = buf.sysname;
} else if (mode == 'r') {
- snprintf(tmp_uname, sizeof(tmp_uname), "%d.%d.%d",
+ snprintf(tmp_uname, sizeof(tmp_uname), "%d.%d.%d",
buf.netware_major, buf.netware_minor, buf.netware_revision);
php_uname = tmp_uname;
} else if (mode == 'n') {
@@ -664,7 +664,7 @@ PHPAPI void php_print_info(int flag TSRMLS_DC)
char temp_api[10];
php_uname = php_get_uname('a');
-
+
if (!sapi_module.phpinfo_as_text) {
php_info_print_box_start(1);
}
@@ -688,7 +688,7 @@ PHPAPI void php_print_info(int flag TSRMLS_DC)
php_info_printf("<h1 class=\"p\">PHP Version %s</h1>\n", PHP_VERSION);
} else {
php_info_print_table_row(2, "PHP Version", PHP_VERSION);
- }
+ }
php_info_print_box_end();
php_info_print_table_start();
php_info_print_table_row(2, "System", php_uname );
@@ -773,7 +773,7 @@ PHPAPI void php_print_info(int flag TSRMLS_DC)
#else
php_info_print_table_row(2, "DTrace Support", "disabled" );
#endif
-
+
php_info_print_stream_hash("PHP Streams", php_stream_get_url_stream_wrappers_hash() TSRMLS_CC);
php_info_print_stream_hash("Stream Socket Transports", php_stream_xport_get_hash() TSRMLS_CC);
php_info_print_stream_hash("Stream Filters", php_get_stream_filters_hash() TSRMLS_CC);
@@ -805,7 +805,7 @@ PHPAPI void php_print_info(int flag TSRMLS_DC)
php_info_print("<h1>Configuration</h1>\n");
} else {
SECTION("Configuration");
- }
+ }
if (!(flag & PHP_INFO_MODULES)) {
SECTION("PHP Core");
display_ini_entries(NULL);
@@ -879,7 +879,7 @@ PHPAPI void php_print_info(int flag TSRMLS_DC)
}
- if ((flag & PHP_INFO_CREDITS) && !sapi_module.phpinfo_as_text) {
+ if ((flag & PHP_INFO_CREDITS) && !sapi_module.phpinfo_as_text) {
php_info_print_hr();
php_print_credits(PHP_CREDITS_ALL & ~PHP_CREDITS_FULLPAGE TSRMLS_CC);
}
@@ -920,17 +920,17 @@ PHPAPI void php_print_info(int flag TSRMLS_DC)
if (!sapi_module.phpinfo_as_text) {
php_info_print("</div></body></html>");
- }
+ }
}
/* }}} */
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");
- }
+ }
}
/* }}} */
@@ -955,7 +955,7 @@ PHPAPI void php_info_print_box_start(int flag) /* {{{ */
php_info_print("<tr class=\"v\"><td>\n");
} else {
php_info_print("\n");
- }
+ }
}
}
/* }}} */
@@ -988,7 +988,7 @@ PHPAPI void php_info_print_table_colspan_header(int num_cols, char *header) /* {
} else {
spaces = (74 - strlen(header));
php_info_printf("%*s%s%*s\n", (int)(spaces/2), " ", header, (int)(spaces/2), " ");
- }
+ }
}
/* }}} */
@@ -1003,7 +1003,7 @@ PHPAPI void php_info_print_table_header(int num_cols, ...)
va_start(row_elements, num_cols);
if (!sapi_module.phpinfo_as_text) {
php_info_print("<tr class=\"h\">");
- }
+ }
for (i=0; i<num_cols; i++) {
row_element = va_arg(row_elements, char *);
if (!row_element || !*row_element) {
@@ -1032,7 +1032,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,
+static void php_info_print_table_row_internal(int num_cols,
const char *value_class, va_list row_elements)
{
int i;
@@ -1040,13 +1040,13 @@ static void php_info_print_table_row_internal(int num_cols,
if (!sapi_module.phpinfo_as_text) {
php_info_print("<tr>");
- }
+ }
for (i=0; i<num_cols; i++) {
if (!sapi_module.phpinfo_as_text) {
php_info_printf("<td class=\"%s\">",
(i==0 ? "e" : value_class )
);
- }
+ }
row_element = va_arg(row_elements, char *);
if (!row_element || !*row_element) {
if (!sapi_module.phpinfo_as_text) {
@@ -1061,7 +1061,7 @@ static void php_info_print_table_row_internal(int num_cols,
php_info_print(row_element);
if (i < num_cols-1) {
php_info_print(" => ");
- }
+ }
}
}
if (!sapi_module.phpinfo_as_text) {
@@ -1081,7 +1081,7 @@ static void php_info_print_table_row_internal(int num_cols,
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);
va_end(row_elements);
@@ -1090,11 +1090,11 @@ PHPAPI void php_info_print_table_row(int num_cols, ...)
/* {{{ php_info_print_table_row_ex
*/
-PHPAPI void php_info_print_table_row_ex(int num_cols, const char *value_class,
+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);
va_end(row_elements);
@@ -1222,7 +1222,7 @@ PHP_FUNCTION(php_ini_scanned_files)
if (zend_parse_parameters_none() == FAILURE) {
return;
}
-
+
if (strlen(PHP_CONFIG_FILE_SCAN_DIR) && php_ini_scanned_files) {
RETURN_STRING(php_ini_scanned_files, 1);
} else {
@@ -1238,7 +1238,7 @@ PHP_FUNCTION(php_ini_loaded_file)
if (zend_parse_parameters_none() == FAILURE) {
return;
}
-
+
if (php_ini_opened_path) {
RETURN_STRING(php_ini_opened_path, 1);
} else {