Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bringing CSS up to this decade's standards. #231

Merged
merged 4 commits into from Jul 22, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
31 changes: 15 additions & 16 deletions ext/standard/css.c
@@ -1,4 +1,4 @@
/*
/*
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
Expand All @@ -12,7 +12,7 @@
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Colin Viebrock <colin@easydns.com> |
| Authors: Colin Viebrock <colin@viebrock.ca> |
+----------------------------------------------------------------------+
*/

Expand All @@ -23,25 +23,24 @@

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("a:link {color: #000099; text-decoration: none; background-color: #ffffff;}\n");
PUTS("body {background-color: #fff; color: #222; font-family: sans-serif;}\n");
PUTS("pre {margin: 0; font-family: monospace;}\n");
PUTS("a:link {color: #009; text-decoration: none; background-color: #fff;}\n");
PUTS("a:hover {text-decoration: underline;}\n");
PUTS("table {border-collapse: collapse;}\n");
PUTS("table {border-collapse: collapse; border: 0; width: 934px; box-shadow: 1px 2px 3px #ccc;}\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(".center table {margin: 1em auto; text-align: left;}\n");
PUTS(".center th {text-align: center !important;}\n");
PUTS("td, th {border: 1px solid #666; font-size: 75%; vertical-align: baseline; padding: 4px 5px;}\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(".e {background-color: #ccf; width: 300px; font-weight: bold;}\n");
PUTS(".h {background-color: #99c; font-weight: bold;}\n");
PUTS(".v {background-color: #ddd; max-width: 300px; overflow-x: auto;}\n");
PUTS(".v i {color: #999;}\n");
PUTS("img {float: right; border: 0;}\n");
PUTS("hr {width: 934px; background-color: #ccc; border: 0; height: 1px;}\n");
}
/* }}} */

Expand Down
4 changes: 2 additions & 2 deletions ext/standard/css.h
@@ -1,4 +1,4 @@
/*
/*
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
Expand All @@ -12,7 +12,7 @@
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Colin Viebrock <colin@easydns.com> |
| Authors: Colin Viebrock <colin@viebrock.ca> |
+----------------------------------------------------------------------+
*/

Expand Down
70 changes: 35 additions & 35 deletions ext/standard/info.c
@@ -1,4 +1,4 @@
/*
/*
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
Expand All @@ -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> |
+----------------------------------------------------------------------+
*/

Expand Down Expand Up @@ -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);
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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)
{
Expand All @@ -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");
}
Expand Down Expand Up @@ -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);
}
}
}
}
/* }}} */
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -432,7 +432,7 @@ char* php_get_windows_name()
sub = "Web Edition";
else sub = "Standard Edition";
}
}
}
}

if ( osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 1 ) {
Expand Down Expand Up @@ -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') {
Expand Down Expand Up @@ -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') {
Expand Down Expand Up @@ -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);
}
Expand All @@ -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 );
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -920,24 +920,24 @@ 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");
}
}
}
/* }}} */

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");
}

}
Expand All @@ -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");
}
}
}
}
/* }}} */
Expand Down Expand Up @@ -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), " ");
}
}
}
/* }}} */

Expand All @@ -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) {
Expand Down Expand Up @@ -1032,21 +1032,21 @@ 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;
char *row_element;

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) {
Expand All @@ -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) {
Expand All @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down