改名
This commit is contained in:
@@ -21,6 +21,7 @@ use Http\Message\Stream;
|
|||||||
use Kiri\Abstracts\Config;
|
use Kiri\Abstracts\Config;
|
||||||
use Kiri\Di\ContainerInterface;
|
use Kiri\Di\ContainerInterface;
|
||||||
use Kiri\Exception\ConfigException;
|
use Kiri\Exception\ConfigException;
|
||||||
|
use Kiri\Kiri;
|
||||||
use Psr\Http\Message\ServerRequestInterface;
|
use Psr\Http\Message\ServerRequestInterface;
|
||||||
use Server\Context;
|
use Server\Context;
|
||||||
use Swoole\Http\Request;
|
use Swoole\Http\Request;
|
||||||
@@ -58,9 +59,6 @@ class Server implements OnRequestInterface
|
|||||||
*/
|
*/
|
||||||
public function init()
|
public function init()
|
||||||
{
|
{
|
||||||
$this->container->mapping(RequestInterface::class, Constrict\Request::class);
|
|
||||||
$this->container->mapping(ResponseInterface::class, Constrict\Response::class);
|
|
||||||
|
|
||||||
$exceptionHandler = Config::get('exception.http', ExceptionHandlerDispatcher::class);
|
$exceptionHandler = Config::get('exception.http', ExceptionHandlerDispatcher::class);
|
||||||
if (!in_array(ExceptionHandlerInterface::class, class_implements($exceptionHandler))) {
|
if (!in_array(ExceptionHandlerInterface::class, class_implements($exceptionHandler))) {
|
||||||
$exceptionHandler = ExceptionHandlerDispatcher::class;
|
$exceptionHandler = ExceptionHandlerDispatcher::class;
|
||||||
|
|||||||
@@ -5,9 +5,14 @@ namespace Server;
|
|||||||
|
|
||||||
use Annotation\Inject;
|
use Annotation\Inject;
|
||||||
use Exception;
|
use Exception;
|
||||||
|
use Http\Constrict\Request;
|
||||||
|
use Http\Constrict\RequestInterface;
|
||||||
|
use Http\Constrict\Response;
|
||||||
|
use Http\Constrict\ResponseInterface;
|
||||||
use Http\Handler\Abstracts\HttpService;
|
use Http\Handler\Abstracts\HttpService;
|
||||||
use JetBrains\PhpStorm\Pure;
|
use JetBrains\PhpStorm\Pure;
|
||||||
use Kiri\Abstracts\Config;
|
use Kiri\Abstracts\Config;
|
||||||
|
use Kiri\Di\ContainerInterface;
|
||||||
use Kiri\Error\LoggerProcess;
|
use Kiri\Error\LoggerProcess;
|
||||||
use Kiri\Events\EventDispatch;
|
use Kiri\Events\EventDispatch;
|
||||||
use Kiri\Exception\ConfigException;
|
use Kiri\Exception\ConfigException;
|
||||||
@@ -44,11 +49,19 @@ class Server extends HttpService
|
|||||||
public EventDispatch $eventDispatch;
|
public EventDispatch $eventDispatch;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/** @var ContainerInterface */
|
||||||
|
#[Inject(ContainerInterface::class)]
|
||||||
|
public ContainerInterface $container;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public function init()
|
public function init()
|
||||||
{
|
{
|
||||||
|
$this->container->mapping(RequestInterface::class, Request::class);
|
||||||
|
$this->container->mapping(ResponseInterface::class, Response::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user