ContainerAwareHttpKernel устаревший
class ContainerAwareHttpKernel extends HttpKernel
устаревший
Добавляет управляемый scope запроса.
Методы
| __construct(EventDispatcherInterface $dispatcher, ContainerInterface $container, ControllerResolverInterface $controllerResolver, RequestStack $requestStack = null, bool $triggerDeprecation = true) Конструктор. | ||
| Response | handle(Request $request, int $type = HttpKernelInterface::MASTER_REQUEST, bool $catch = true) Обрабатывает запрос для преобразования его в ответ. | |
| terminate(Request $request, Response $response) Завершает цикл запроса/ответа. | из HttpKernel | |
| terminateWithException(Exception $exception) | из HttpKernel |
Подробности
__construct(EventDispatcherInterface $dispatcher, ContainerInterface $container, ControllerResolverInterface $controllerResolver, RequestStack $requestStack = null, bool $triggerDeprecation = true)
Конструктор.
Параметры
| EventDispatcherInterface | $dispatcher | Экземпляр EventDispatcherInterface |
| ContainerInterface | $container | Экземпляр ContainerInterface |
| ControllerResolverInterface | $controllerResolver | Экземпляр ControllerResolverInterface |
| RequestStack | $requestStack | Стек для основных/вложенных запросов |
| bool | $triggerDeprecation | Вызывать ли предупреждение об устаревании для ContainerAwareHttpKernel |
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.0/Symfony/Component/HttpKernel/DependencyInjection/ContainerAwareHttpKernel.html