class HttpKernel implements HttpKernelInterface (View source)

Describes how a request is handled.

Traits

Provide middleware definitions.
Provide middleware sorting.
Converts values to a response.
Describes how a request is handled.
Executes middleware.

Methods

void
setMiddleware(array $middleware)

Register middleware.

void
setMiddlewareGroups(array $middleware_groups)

Register middleware groups.

string[]
uniqueMiddleware(array[] $middleware)

Filter array of middleware into a unique set.

array[]
expandMiddleware(string[] $middleware)

Expand array of middleware into an array of fully qualified class names.

array[]
expandMiddlewareGroup(string $group)

Expand a middleware group into an array of fully qualified class names.

array[]
expandMiddlewareMolecule(string $middleware)

Expand middleware into an array of fully qualified class names and any companion arguments.

string
expandMiddlewareAtom(string $middleware)

Expand a single middleware a fully qualified class name.

string[]
getMiddlewarePriority()

Get middleware execution priority.

void
setMiddlewarePriority(string[] $middleware_priority)

Set middleware execution priority.

integer
getMiddlewarePriorityForMiddleware(string|array $middleware)

Get priority for a specific middleware.

array
sortMiddleware(string[] $middleware)

Sort array of fully qualified middleware class names by priority in ascending order.

__construct(Container $container, GenericFactory $factory, HandlerFactory $handler_factory, ResponseService $response_service, RequestInterface $request, Router $router, ViewService $view_service, ErrorHandlerInterface $error_handler)

Constructor.

ResponseInterface
run(RequestInterface $request, string[] $middleware, string|Closure|Handler $handler, array $arguments = [])

Run a response pipeline for the given request.

ResponseInterface|null
handle(RequestInterface $request, array $arguments = [])

Return a response for the given request.

void
respond()

Respond with the current response.

void
compose()

Output the current view outside of the routing flow.

void
bootstrap()

Bootstrap the kernel.

array
filterRequest(array $query_vars)

Filter the main query vars.

string
filterTemplateInclude(string $template)

Filter the main template file.

void
registerAjaxAction()

Register ajax action to hook into current one.

void
actionAjax()

Act on ajax action.

void
registerAdminAction()

Register admin action to hook into current one.

void
actionAdminLoad()

Act on admin action load.

void
actionAdmin()

Act on admin action.

Details

void setMiddleware(array $middleware)

Register middleware.

Parameters

array $middleware string> $middleware

Return Value

void

void setMiddlewareGroups(array $middleware_groups)

Register middleware groups.

Parameters

array $middleware_groups string[]> $middleware_groups

Return Value

void

string[] uniqueMiddleware(array[] $middleware)

Filter array of middleware into a unique set.

Parameters

array[] $middleware

Return Value

string[]

array[] expandMiddleware(string[] $middleware)

Expand array of middleware into an array of fully qualified class names.

Parameters

string[] $middleware

Return Value

array[]

array[] expandMiddlewareGroup(string $group)

Expand a middleware group into an array of fully qualified class names.

Parameters

string $group

Return Value

array[]

array[] expandMiddlewareMolecule(string $middleware)

Expand middleware into an array of fully qualified class names and any companion arguments.

Parameters

string $middleware

Return Value

array[]

string expandMiddlewareAtom(string $middleware)

Expand a single middleware a fully qualified class name.

Parameters

string $middleware

Return Value

string

string[] getMiddlewarePriority()

Get middleware execution priority.

Return Value

string[]

void setMiddlewarePriority(string[] $middleware_priority)

Set middleware execution priority.

Parameters

string[] $middleware_priority

Return Value

void

integer getMiddlewarePriorityForMiddleware(string|array $middleware)

Get priority for a specific middleware.

This is in reverse compared to definition order. Middleware with unspecified priority will yield -1.

Parameters

string|array $middleware

Return Value

integer

array sortMiddleware(string[] $middleware)

Sort array of fully qualified middleware class names by priority in ascending order.

Parameters

string[] $middleware

Return Value

array

__construct(Container $container, GenericFactory $factory, HandlerFactory $handler_factory, ResponseService $response_service, RequestInterface $request, Router $router, ViewService $view_service, ErrorHandlerInterface $error_handler)

Constructor.

Parameters

Container $container
GenericFactory $factory
HandlerFactory $handler_factory
ResponseService $response_service
RequestInterface $request
Router $router
ViewService $view_service
ErrorHandlerInterface $error_handler

ResponseInterface run(RequestInterface $request, string[] $middleware, string|Closure|Handler $handler, array $arguments = [])

Run a response pipeline for the given request.

Parameters

RequestInterface $request
string[] $middleware
string|Closure|Handler $handler
array $arguments

Return Value

ResponseInterface

ResponseInterface|null handle(RequestInterface $request, array $arguments = [])

Return a response for the given request.

Parameters

RequestInterface $request
array $arguments

Return Value

ResponseInterface|null

void respond()

Respond with the current response.

Return Value

void

void compose()

Output the current view outside of the routing flow.

Return Value

void

void bootstrap()

Bootstrap the kernel.

Return Value

void

array filterRequest(array $query_vars)

Filter the main query vars.

Parameters

array $query_vars

Return Value

array

string filterTemplateInclude(string $template)

Filter the main template file.

Parameters

string $template

Return Value

string

void registerAjaxAction()

Register ajax action to hook into current one.

Return Value

void

void actionAjax()

Act on ajax action.

Return Value

void

void registerAdminAction()

Register admin action to hook into current one.

Return Value

void

void actionAdminLoad()

Act on admin action load.

Return Value

void

void actionAdmin()

Act on admin action.

Return Value

void