php-middleware / maintenance
Site maintenance middleware SEO friendly with PSR-7
2.0.0
2018-10-16 10:44 UTC
Requires
- php: >=7.1
- psr/http-factory: ^1.0
- psr/http-factory-implementation: ^1.0
- psr/http-message: ^1.0
- psr/http-server-handler: ^1.0
- psr/http-server-middleware: ^1.0
Requires (Dev)
- phpunit/phpunit: ^7.3
- zendframework/zend-diactoros: ^2.0
This package is not auto-updated.
Last update: 2024-11-09 19:04:41 UTC
README
Site maintenance middleware SEO friendly
How to usage
Create instance of middleware as you want (we use named constructors) and add it to middleware runner.
$date = DateTime::createFromFormat('Y-m-d H:i:s', '2025-11-30 11:12:13'); $middleware = MaintenanceMiddleware::createWithRetryAsDateTime($date, $psr17ResponseFactory); $middlewareRunner->add($middleware); $middlewareRunner->run();
Features
- Setup 503 status code,
- Supports
Retry-After
header (as seconds or HTTP-date), - Supports
Redirect
header (redirect page afterRetry-After
time).
More about this SEO practice: How to deal with planned site downtime in Google Webmaster Central Blog.
How to install
Use composer!
composer require php-middleware/maintenance
This package require PSR-17 message factory implementation to return SEO friendly response.