atst / stack-backstage
A stack middleware for displaying maintenance pages
Installs: 6 388
Dependents: 0
Suggesters: 0
Security: 0
Stars: 39
Watchers: 3
Forks: 0
Open Issues: 3
Requires
- php: >=5.4.0
- symfony/http-foundation: ~2.1
- symfony/http-kernel: ~2.1
Requires (Dev)
- stack/callable-http-kernel: ~1.0@dev
This package is auto-updated.
Last update: 2024-10-06 12:02:33 UTC
README
A Stack middleware for displaying maintenance pages.
The middleware takes a path, if a file exists at that path, it's contents are returned with a 503 status code.
Example
<?php $app = new Silex\Application(); $app->get('/', function () { return 'my app is working'; }); $stack = (new Stack\Builder()) ->push('Atst\StackBackstage', __DIR__.'/maintenance.html'); $app = $stack->resolve($app);
Usage
When you need to take the site down for maintenance
$ echo "<h1>Down for Maintenance</h1>" > /path/to/your/app/maintenance.html
Inspiration
Ported from rack/rack-contrib