Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/php-middleware/maintenance
Site maintenance SEO PSR-15 middleware
https://github.com/php-middleware/maintenance
maintenance maintenance-mode middleware php psr-15 psr-17 psr-7 seo
Last synced: about 2 months ago
JSON representation
Site maintenance SEO PSR-15 middleware
- Host: GitHub
- URL: https://github.com/php-middleware/maintenance
- Owner: php-middleware
- License: mit
- Created: 2015-09-02T18:09:53.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2021-04-29T20:08:17.000Z (over 3 years ago)
- Last Synced: 2024-07-31T18:15:19.283Z (4 months ago)
- Topics: maintenance, maintenance-mode, middleware, php, psr-15, psr-17, psr-7, seo
- Language: PHP
- Homepage:
- Size: 12.7 KB
- Stars: 7
- Watchers: 4
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-http - php-middleware/maintenance
README
# maintenance [![Build Status](https://travis-ci.org/php-middleware/maintenance.svg?branch=master)](https://travis-ci.org/php-middleware/maintenance)
Site maintenance middleware SEO friendly## How to usage
Create instance of middleware as you want (we use [named constructors](http://verraes.net/2014/06/named-constructors-in-php/)) and add it to middleware runner.
```php
$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 after `Retry-After` time).More about this SEO practice: [How to deal with planned site downtime](http://googlewebmastercentral.blogspot.com/2011/01/how-to-deal-with-planned-site-downtime.html) in Google Webmaster Central Blog.
## How to install
Use composer!
```bash
composer require php-middleware/maintenance
```This package require [PSR-17 message factory](https://packagist.org/providers/psr/http-factory-implementation) implementation to return SEO friendly response.