class HTTPApplication implements Application

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

in HTTPMiddlewareAware at line 22
HTTPMiddleware[] getMiddlewares()

Return Value

HTTPMiddleware[]

in HTTPMiddlewareAware at line 31
$this setMiddlewares(HTTPMiddleware[] $middlewares)

Parameters

HTTPMiddleware[] $middlewares

Return Value

$this

in HTTPMiddlewareAware at line 42
$this addMiddleware(HTTPMiddleware $middleware)

Parameters

HTTPMiddleware $middleware

Return Value

$this

at line 40
__construct(Kernel $kernel)

Initialize the application with a kernel instance

Parameters

Kernel $kernel

at line 52
$this setFlushDiscoverer(FlushDiscoverer $discoverer)

Override the default flush discovery

Parameters

FlushDiscoverer $discoverer

Return Value

$this

at line 65
FlushDiscoverer getFlushDiscoverer(HTTPRequest $request)

Returns the current flush discoverer

Parameters

HTTPRequest $request a request to probe for flush parameters

Return Value

FlushDiscoverer

at line 100
Kernel getKernel()

Get the kernel for this application

Return Value

Kernel

at line 111
HTTPResponse handle(HTTPRequest $request)

Handle the given HTTP request

Parameters

HTTPRequest $request

Return Value

HTTPResponse

at line 130
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