MaintenanceMiddleware
in package
implements
MiddlewareInterface
The maintenance middleware allows Spitfire to provide a maintenance mode, if the administrator creates the file `.maintenance` containing information for the user, the maintenance mode will fire an exception that will prevent execution from continuing and try to fetch a user error page for the maintenance mode.
The administrator can create a .maintenance
file that can either contain a message
or a json object with the keys message
and code
that will be used to generate
a maintenance exception.
For example, the app owner may determine that the codes mean the following:
1: Scheduled maintenance 2: Technical difficulties
The /bin/error_pages/spitfire/mvc/middleware/exceptions/MaintenanceMode/
directory
could contain error documents 1.php
and 2.php
to provide information according
to the state of the application.
Tags
Interfaces, Classes and Traits
- MiddlewareInterface
Table of Contents
- $response : mixed
- __construct() : mixed
- after() : mixed
- before() : mixed
- process() : ResponseInterface
Properties
$response
private
mixed
$response
Methods
__construct()
public
__construct(ResponseInterface $response) : mixed
Parameters
- $response : ResponseInterface
Return values
mixed —after()
public
after(ContextInterface $context[, Response $response = null ]) : mixed
Parameters
- $context : ContextInterface
- $response : Response = null
Tags
Return values
mixed —before()
public
before(ContextInterface $context) : mixed
Parameters
- $context : ContextInterface
Tags
Return values
mixed —process()
public
process(ServerRequestInterface $request, RequestHandlerInterface $handler) : ResponseInterface
Parameters
- $request : ServerRequestInterface
- $handler : RequestHandlerInterface