改名
This commit is contained in:
@@ -14,7 +14,9 @@ use HttpServer\IInterface\IFormatter;
|
||||
use Kiri\Abstracts\Component;
|
||||
use Kiri\Core\Json;
|
||||
use Kiri\Event;
|
||||
use Kiri\Events\EventDispatch;
|
||||
use Kiri\Kiri;
|
||||
use Server\Events\OnAfterRequest;
|
||||
|
||||
/**
|
||||
* Class ErrorHandler
|
||||
@@ -74,7 +76,7 @@ class ErrorHandler extends Component implements ErrorInterface
|
||||
{
|
||||
$this->category = 'exception';
|
||||
|
||||
Event::trigger(Event::SYSTEM_RESOURCE_CLEAN);
|
||||
di(EventDispatch::class)->dispatch(new OnAfterRequest());
|
||||
|
||||
$this->sendError($exception->getMessage(), $exception->getFile(), $exception->getLine());
|
||||
}
|
||||
@@ -99,7 +101,8 @@ class ErrorHandler extends Component implements ErrorInterface
|
||||
|
||||
Kiri::app()->error($data, 'error');
|
||||
|
||||
Event::trigger(Event::SYSTEM_RESOURCE_CLEAN);
|
||||
di(EventDispatch::class)->dispatch(new OnAfterRequest());
|
||||
|
||||
|
||||
throw new \ErrorException($error[1], $error[0], 1, $error[2], $error[3]);
|
||||
}
|
||||
|
||||
@@ -9,9 +9,9 @@ use JetBrains\PhpStorm\Pure;
|
||||
use Server\SInterface\CustomProcess;
|
||||
use Kiri\Core\Json;
|
||||
use Kiri\Exception\ComponentException;
|
||||
use Kiri\Process\Process;
|
||||
use Kiri\Kiri;
|
||||
use Swoole\Coroutine;
|
||||
use Swoole\Process;
|
||||
|
||||
|
||||
/**
|
||||
@@ -24,7 +24,7 @@ class LoggerProcess implements CustomProcess
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
#[Pure] public function getProcessName(\Swoole\Process $process): string
|
||||
#[Pure] public function getProcessName(Process $process): string
|
||||
{
|
||||
// TODO: Implement getProcessName() method.
|
||||
return get_called_class();
|
||||
@@ -32,10 +32,10 @@ class LoggerProcess implements CustomProcess
|
||||
|
||||
|
||||
/**
|
||||
* @param \Swoole\Process $process
|
||||
* @param Process $process
|
||||
* @throws ComponentException
|
||||
*/
|
||||
public function onHandler(\Swoole\Process $process): void
|
||||
public function onHandler(Process $process): void
|
||||
{
|
||||
// TODO: Implement onHandler() method.
|
||||
$this->message($process);
|
||||
@@ -43,11 +43,11 @@ class LoggerProcess implements CustomProcess
|
||||
|
||||
|
||||
/**
|
||||
* @param \Swoole\Process $process
|
||||
* @param Process $process
|
||||
* @throws ComponentException
|
||||
* @throws Exception
|
||||
*/
|
||||
public function message(\Swoole\Process $process)
|
||||
public function message(Process $process)
|
||||
{
|
||||
$message = Json::decode($process->read());
|
||||
if (!empty($message)) {
|
||||
|
||||
Reference in New Issue
Block a user