Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
snapshotpl committed Nov 30, 2015
1 parent 89dd8a7 commit 7375b08
Showing 1 changed file with 29 additions and 4 deletions.
33 changes: 29 additions & 4 deletions README.md
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"
}
}
```

0 comments on commit 7375b08

Please sign in to comment.