改名
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace Http\Constrict;
|
namespace Http\Constrict;
|
||||||
|
|
||||||
use Http\Handler\Context;
|
use Server\Context;
|
||||||
use Http\Handler\AuthIdentity;
|
use Http\Handler\AuthIdentity;
|
||||||
use JetBrains\PhpStorm\Pure;
|
use JetBrains\PhpStorm\Pure;
|
||||||
use Kiri\Kiri;
|
use Kiri\Kiri;
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
namespace Http\Constrict;
|
namespace Http\Constrict;
|
||||||
|
|
||||||
|
|
||||||
use Http\Handler\Context;
|
use Server\Context;
|
||||||
use Http\Message\ContentType;
|
use Http\Message\ContentType;
|
||||||
use JetBrains\PhpStorm\Pure;
|
use JetBrains\PhpStorm\Pure;
|
||||||
use Kiri\Abstracts\Config;
|
use Kiri\Abstracts\Config;
|
||||||
|
|||||||
@@ -47,13 +47,10 @@ class Server implements OnRequestInterface
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param ContainerInterface $container
|
* @var ContainerInterface
|
||||||
*/
|
*/
|
||||||
public function __construct(protected ContainerInterface $container)
|
#[Inject(ContainerInterface::class)]
|
||||||
{
|
protected ContainerInterface $container;
|
||||||
$this->container->setBindings(RequestInterface::class, Constrict\Request::class);
|
|
||||||
$this->container->setBindings(ResponseInterface::class, Constrict\Response::class);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -61,6 +58,9 @@ class Server implements OnRequestInterface
|
|||||||
*/
|
*/
|
||||||
public function init()
|
public function init()
|
||||||
{
|
{
|
||||||
|
$this->container->setBindings(RequestInterface::class, Constrict\Request::class);
|
||||||
|
$this->container->setBindings(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;
|
||||||
|
|||||||
Reference in New Issue
Block a user