Skip to content

Commit 7375b08

Browse files
committed
Update readme
1 parent 89dd8a7 commit 7375b08

File tree

1 file changed

+29
-4
lines changed

1 file changed

+29
-4
lines changed

README.md

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,35 @@
11
# maintenance [![Build Status](https://travis-ci.org/php-middleware/maintenance.svg?branch=master)](https://travis-ci.org/php-middleware/maintenance)
22
Site maintenance middleware SEO friendly
33

4+
## How to usage
5+
6+
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.
7+
8+
```php
9+
$date = DateTime::createFromFormat('Y-m-d H:i:s', '2025-11-30 11:12:13');
10+
11+
$middleware = MaintenanceMiddleware::createWithRetryAsDateTime($date);
12+
13+
$middlewareRunner->add(middleware);
14+
$middlewareRunner->run();
15+
```
16+
417
## Features
518

6-
* Setup 503 header,
7-
* Support `Retry-After` header (as seconds, or HTTP-date),
8-
* Support `Redirect` header (redirect page after `Retry-After` time).
19+
* Setup 503 status code,
20+
* Supports `Retry-After` header (as seconds or HTTP-date),
21+
* Supports `Redirect` header (redirect page after `Retry-After` time).
22+
23+
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.
24+
25+
## How to install
26+
27+
Use composer!
928

10-
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.
29+
```json
30+
{
31+
"require": {
32+
"php-middleware/maintenance": "^1.0.0"
33+
}
34+
}
35+
```

0 commit comments

Comments
 (0)