middlewares/shutdown

Middleware to display a 503 maintenance page

v1.1.0 2018-08-04 10:41 UTC

README

Latest Version on Packagist Software License Build Status Quality Score Total Downloads SensioLabs Insight

Middleware to display a 503 maintenance page.

Requirements

Installation

This package is installable and autoloadable via Composer as middlewares/shutdown.

composer require middlewares/shutdown

Example

$dispatcher = new Dispatcher([
	(new Middlewares\Shutdown())->retryAfter(60 * 5)
]);

$response = $dispatcher->dispatch(new ServerRequest());

Options

__construct(Interop\Http\Server\RequestHandlerInterface $handler = null)

The request handler used to generate the response. If it's not provided, the default will be used.

retryAfter(int|DateTimeInterface $duration)

If known, the length of the downtime in seconds or the estimated date and time when the downtime will be complete. More info about why this

Please see CHANGELOG for more information about recent changes and CONTRIBUTING for contributing details.

The MIT License (MIT). Please see LICENSE for more information.