改名
This commit is contained in:
@@ -209,11 +209,11 @@ class Response extends HttpService
|
|||||||
private function printResult($result): void
|
private function printResult($result): void
|
||||||
{
|
{
|
||||||
$result = Help::toString($result);
|
$result = Help::toString($result);
|
||||||
$string = 'Command Result: ' . PHP_EOL . PHP_EOL;
|
|
||||||
fire('CONSOLE_END');
|
fire('CONSOLE_END');
|
||||||
if (str_contains((string)$result, 'Event::rshutdown(): Event::wait()')) {
|
if (str_contains((string)$result, 'Event::rshutdown(): Event::wait()')) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
$string = 'Command Result: ' . PHP_EOL . PHP_EOL;
|
||||||
if (empty($result)) {
|
if (empty($result)) {
|
||||||
$string .= 'success!' . PHP_EOL . PHP_EOL;
|
$string .= 'success!' . PHP_EOL . PHP_EOL;
|
||||||
} else {
|
} else {
|
||||||
@@ -224,6 +224,7 @@ class Response extends HttpService
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param $sendData
|
* @param $sendData
|
||||||
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
private function sendData($sendData): void
|
private function sendData($sendData): void
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -513,7 +513,7 @@ class Router extends HttpService implements RouterInterface
|
|||||||
$node = $this->find_path($request);
|
$node = $this->find_path($request);
|
||||||
if (!($node instanceof Node)) {
|
if (!($node instanceof Node)) {
|
||||||
$this->response->setFormat(Response::HTML);
|
$this->response->setFormat(Response::HTML);
|
||||||
$this->response->send('<h1 style="text-align: center;">404</h1>');
|
$this->response->send('<h2>HTTP 404 Not Found</h2><hr><i>Powered by Swoole</i>');
|
||||||
} else {
|
} else {
|
||||||
$this->response->send($node->dispatch(), 200);
|
$this->response->send($node->dispatch(), 200);
|
||||||
}
|
}
|
||||||
@@ -526,7 +526,7 @@ class Router extends HttpService implements RouterInterface
|
|||||||
public function pageNotFound()
|
public function pageNotFound()
|
||||||
{
|
{
|
||||||
$this->response->setFormat(Response::HTML);
|
$this->response->setFormat(Response::HTML);
|
||||||
$this->response->send('<h1 style="text-align: center;">404</h1>');
|
$this->response->send('<h2>HTTP 404 Not Found</h2><hr><i>Powered by Swoole</i>');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user