A stack middleware for displaying maintenance pages
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src/Atst
tests/integration
.gitignore
LICENCE
README.md
composer.json
composer.lock
phpunit.xml.dist

README.md

Atst/StackBackstage

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