-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
89dd8a7
commit 7375b08
Showing
1 changed file
with
29 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,35 @@ | ||
# 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); | ||
|
||
$middlewareRunner->add(middleware); | ||
$middlewareRunner->run(); | ||
``` | ||
|
||
## Features | ||
|
||
* Setup 503 header, | ||
* Support `Retry-After` header (as seconds, or HTTP-date), | ||
* Support `Redirect` header (redirect page after `Retry-After` time). | ||
* 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! | ||
|
||
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. | ||
```json | ||
{ | ||
"require": { | ||
"php-middleware/maintenance": "^1.0.0" | ||
} | ||
} | ||
``` |