HTTPApplication
class HTTPApplication implements Application (View source)
Invokes the HTTP application within an ErrorControlChain
Traits
Adds middleware support to an object.
Properties
protected | HTTPMiddleware[] | $middlewares | from HTTPMiddlewareAware | |
protected | Kernel | $kernel |
Methods
Return the current environment type (dev, test or live) Only checks Kernel and Server ENV as we don't have sessions initialized yet
Safely boot the application and execute the given main action
Details
HTTPMiddleware[]
getMiddlewares()
No description
$this
setMiddlewares(HTTPMiddleware[] $middlewares)
No description
$this
addMiddleware(HTTPMiddleware $middleware)
No description
protected HTTPResponse
callMiddleware(HTTPRequest $request, callable $last)
Call middleware
__construct(Kernel $kernel)
Initialize the application with a kernel instance
$this
setFlushDiscoverer(FlushDiscoverer $discoverer)
Override the default flush discovery
FlushDiscoverer
getFlushDiscoverer(HTTPRequest $request)
Returns the current flush discoverer
protected string
getEnvironmentType()
Return the current environment type (dev, test or live) Only checks Kernel and Server ENV as we don't have sessions initialized yet
Kernel
getKernel()
Get the kernel for this application
HTTPResponse
handle(HTTPRequest $request)
Handle the given HTTP request
HTTPResponse
execute(HTTPRequest $request, callable $callback, bool $flush = false)
Safely boot the application and execute the given main action