class HTTPApplication implements Application (View source)

Invokes the HTTP application within an ErrorControlChain

Traits

Adds middleware support to an object.

Methods

$this
setMiddlewares(HTTPMiddleware[] $middlewares)

No description

$this
addMiddleware(HTTPMiddleware $middleware)

No description

__construct(Kernel $kernel)

Initialize the application with a kernel instance

$this
setFlushDiscoverer(FlushDiscoverer $discoverer)

Override the default flush discovery

getFlushDiscoverer(HTTPRequest $request)

Returns the current flush discoverer

getKernel()

Get the kernel for this application

handle(HTTPRequest $request)

Handle the given HTTP request

execute(HTTPRequest $request, callable $callback, bool $flush = false)

Safely boot the application and execute the given main action

Details

HTTPMiddleware[] getMiddlewares()

Return Value

HTTPMiddleware[]

$this setMiddlewares(HTTPMiddleware[] $middlewares)

Parameters

HTTPMiddleware[] $middlewares

Return Value

$this

$this addMiddleware(HTTPMiddleware $middleware)

Parameters

HTTPMiddleware $middleware

Return Value

$this

__construct(Kernel $kernel)

Initialize the application with a kernel instance

Parameters

Kernel $kernel

$this setFlushDiscoverer(FlushDiscoverer $discoverer)

Override the default flush discovery

Parameters

FlushDiscoverer $discoverer

Return Value

$this

FlushDiscoverer getFlushDiscoverer(HTTPRequest $request)

Returns the current flush discoverer

Parameters

HTTPRequest $request

a request to probe for flush parameters

Return Value

FlushDiscoverer

Kernel getKernel()

Get the kernel for this application

Return Value

Kernel

HTTPResponse handle(HTTPRequest $request)

Handle the given HTTP request

Parameters

HTTPRequest $request

Return Value

HTTPResponse

HTTPResponse execute(HTTPRequest $request, callable $callback, bool $flush = false)

Safely boot the application and execute the given main action

Parameters

HTTPRequest $request
callable $callback
bool $flush

Return Value

HTTPResponse