Spec-Zone.ru › Symfony 3.1

HttpKernel

class HttpKernel implements HttpKernelInterface, TerminableInterface

HttpKernel уведомляет события для преобразования объекта Request в объект Response.

Методы

__construct(EventDispatcherInterface $dispatcher, ControllerResolverInterface $resolver, RequestStack $requestStack = null, ArgumentResolverInterface $argumentResolver = null)
Response handle(Request $request, int $type = HttpKernelInterface::MASTER_REQUEST, bool $catch = true)

Обрабатывает запрос для его преобразования в ответ.

terminate(Request $request, Response $response)

Завершает цикл запроса/ответа.

terminateWithException(Exception $exception)

Детали

__construct(EventDispatcherInterface $dispatcher, ControllerResolverInterface $resolver, RequestStack $requestStack = null, ArgumentResolverInterface $argumentResolver = null)

Параметры

EventDispatcherInterface $dispatcher
ControllerResolverInterface $resolver
RequestStack $requestStack
ArgumentResolverInterface $argumentResolver

Response handle(Request $request, int $type = HttpKernelInterface::MASTER_REQUEST, bool $catch = true)

Обрабатывает запрос для его преобразования в ответ.

Когда $catch равно true, реализация должна перехватывать все исключения и по возможности преобразовывать их в экземпляр Response.

Параметры

Request $request Экземпляр Request
int $type Тип запроса (один из HttpKernelInterface::MASTER_REQUEST или HttpKernelInterface::SUB_REQUEST)
bool $catch Перехватывать исключения или нет

Значение возврата

Response Экземпляр Response

Исключения

Exception При возникновении исключения во время обработки

terminate(Request $request, Response $response)

Завершает цикл запроса/ответа.

Должен вызываться после отправки ответа и перед завершением работы ядра.

Параметры

Request $request Экземпляр Request
Response $response Экземпляр Response

terminateWithException(Exception $exception)

Параметры

Exception $exception

Исключения

LogicException Если стек запросов пуст

© 2004–2017 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/3.1/Symfony/Component/HttpKernel/HttpKernel.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API