ContainerAwareHttpKernel deprecated
class ContainerAwareHttpKernel extends HttpKernel
deprecated
Добавляет управляемый контекст запроса.
Methods
| __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) Завершает цикл обработки запроса/ответа. | from HttpKernel | |
| terminateWithException(Exception $exception) | from HttpKernel |
Details
__construct(EventDispatcherInterface $dispatcher, ContainerInterface $container, ControllerResolverInterface $controllerResolver, RequestStack $requestStack = null, bool $triggerDeprecation = true)
Конструктор.
Parameters
| 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.
Parameters
| Request | $request | Экземпляр Request |
| int | $type | Тип запроса (HttpKernelInterface::MASTER_REQUEST или HttpKernelInterface::SUB_REQUEST) |
| bool | $catch | Перехватывать исключения или нет |
Return Value
| Response | Экземпляр Response |
Exceptions
| Exception | В случае возникновения исключения во время обработки |
terminate(Request $request, Response $response)
Завершает цикл обработки запроса/ответа.
Должен вызываться после отправки ответа и перед завершением работы ядра.
Parameters
| Request | $request | Экземпляр Request |
| Response | $response | Экземпляр Response |
terminateWithException(Exception $exception)
Parameters
| Exception | $exception |
Exceptions
| LogicException | Если стек запросов пуст |
© 2004–2017 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/3.2/Symfony/Component/HttpKernel/DependencyInjection/ContainerAwareHttpKernel.html