Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion ext/standard/css.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@
#include "php.h"
#include "info.h"

PHPAPI ZEND_COLD void php_info_print_css(void) /* {{{ */
/* {{{ void php_info_print_css(void)
* Perhaps duplicate changes in ext/standard/css.c
* , sapi/cli/php_cli_server.c
*/
PHPAPI ZEND_COLD void php_info_print_css(void)
{
PUTS("body {background-color: #fff; color: #222; font-family: sans-serif;}\n");
PUTS("pre {margin: 0; font-family: monospace;}\n");
Expand Down
54 changes: 47 additions & 7 deletions sapi/cli/php_cli_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -237,14 +237,54 @@ static void php_cli_server_log_response(php_cli_server_client *client, int statu
ZEND_DECLARE_MODULE_GLOBALS(cli_server)

/* {{{ static char php_cli_server_css[]
* copied from ext/standard/info.c
* Perhaps duplicate changes in ext/standard/css.c
* , sapi/cli/php_cli_server.c
*/
static const char php_cli_server_css[] = "<style>\n" \
"body { background-color: #fcfcfc; color: #333333; margin: 0; padding:0; }\n" \
"h1 { font-size: 1.5em; font-weight: normal; background-color: #9999cc; min-height:2em; line-height:2em; border-bottom: 1px inset black; margin: 0; }\n" \
"h1, p { padding-left: 10px; }\n" \
"code.url { background-color: #eeeeee; font-family:monospace; padding:0 2px;}\n" \
"</style>\n";
static const char php_cli_server_css[] = "<style>" \
":root{" \
"--c-black:#000000;" \
"--c-dark-grey:#333333;" \
"--c-lavender-misty:#E2E4EF;" \
"--c-blue-bell:#9999CC;" \
"--c-white:#FCFCFC;" \
"--php-background:light-dark(" \
"var(--c-white),var(--c-dark-grey)" \
");" \
"--php-code-background:var(--c-lavender-misty);" \
"--php-code-foreground:var(--c-black);" \
"--php-foreground:light-dark(" \
"var(--c-dark-grey),var(--c-lavender-misty)" \
");" \
"--php-heading-background:var(--c-blue-bell);" \
"--php-heading-foreground:var(--c-black);" \
"color-scheme:light dark;" \
"}" \
"body{" \
"background-color:var(--php-background);" \
"color:var(--php-foreground);" \
"margin:0;" \
"padding:0;" \
"}" \
"h1{" \
"font-size:1.5em;" \
"font-weight:normal;" \
"background-color:var(--php-heading-background);" \
"color:var(--php-heading-foreground);" \
"min-height:2em;" \
"line-height:2em;" \
"border-bottom:1px inset var(--php-black);" \
"margin:0;" \
"}" \
"h1,p{" \
"padding-left:10px;" \
"}" \
"code.url{" \
"background-color:var(--php-code-background);" \
"color:var(--php-code-foreground);" \
"font-family:monospace;" \
"padding:0 2px;" \
"}" \
"</style>";
/* }}} */

#ifdef PHP_WIN32
Expand Down
15 changes: 5 additions & 10 deletions sapi/cli/tests/php_cli_server_013.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,7 @@ X-Powered-By: PHP/%s
Content-Type: text/html; charset=UTF-8
Content-Length: %d

<!doctype html><html><head><meta name="viewport" content="width=device-width, initial-scale=1"><title>404 Not Found</title><style>AAA</style>
</head><body><h1>Not Found</h1><p>The requested resource <code class="url">/</code> was not found on this server.</p></body></html>
<!doctype html><html><head><meta name="viewport" content="width=device-width, initial-scale=1"><title>404 Not Found</title><style>AAA</style></head><body><h1>Not Found</h1><p>The requested resource <code class="url">/</code> was not found on this server.</p></body></html>
HTTP/1.1 404 Not Found
Host: %s
Date: %s
Expand All @@ -141,8 +140,7 @@ X-Powered-By: PHP/%s
Content-Type: text/html; charset=UTF-8
Content-Length: %d

<!doctype html><html><head><meta name="viewport" content="width=device-width, initial-scale=1"><title>404 Not Found</title><style>AAA</style>
</head><body><h1>Not Found</h1><p>The requested resource <code class="url">/main/style.css</code> was not found on this server.</p></body></html>
<!doctype html><html><head><meta name="viewport" content="width=device-width, initial-scale=1"><title>404 Not Found</title><style>AAA</style></head><body><h1>Not Found</h1><p>The requested resource <code class="url">/main/style.css</code> was not found on this server.</p></body></html>
HTTP/1.1 404 Not Found
Host: %s
Date: %s
Expand All @@ -161,8 +159,7 @@ Content-Type: text/html; charset=UTF-8
Content-Length: %d
Allow: GET, HEAD, POST

<!doctype html><html><head><meta name="viewport" content="width=device-width, initial-scale=1"><title>405 Method Not Allowed</title><style>AAA</style>
</head><body><h1>Method Not Allowed</h1><p>Requested method not allowed.</p></body></html>
<!doctype html><html><head><meta name="viewport" content="width=device-width, initial-scale=1"><title>405 Method Not Allowed</title><style>AAA</style></head><body><h1>Method Not Allowed</h1><p>Requested method not allowed.</p></body></html>
HTTP/1.1 405 Method Not Allowed
Host: %s
Date: %s
Expand All @@ -172,8 +169,7 @@ Content-Type: text/html; charset=UTF-8
Content-Length: %d
Allow: GET, HEAD, POST

<!doctype html><html><head><meta name="viewport" content="width=device-width, initial-scale=1"><title>405 Method Not Allowed</title><style>AAA</style>
</head><body><h1>Method Not Allowed</h1><p>Requested method not allowed.</p></body></html>
<!doctype html><html><head><meta name="viewport" content="width=device-width, initial-scale=1"><title>405 Method Not Allowed</title><style>AAA</style></head><body><h1>Method Not Allowed</h1><p>Requested method not allowed.</p></body></html>
HTTP/1.1 405 Method Not Allowed
Host: %s
Date: %s
Expand All @@ -183,5 +179,4 @@ Content-Type: text/html; charset=UTF-8
Content-Length: %d
Allow: GET, HEAD, POST

<!doctype html><html><head><meta name="viewport" content="width=device-width, initial-scale=1"><title>405 Method Not Allowed</title><style>AAA</style>
</head><body><h1>Method Not Allowed</h1><p>Requested method not allowed.</p></body></html>
<!doctype html><html><head><meta name="viewport" content="width=device-width, initial-scale=1"><title>405 Method Not Allowed</title><style>AAA</style></head><body><h1>Method Not Allowed</h1><p>Requested method not allowed.</p></body></html>
Loading