atst/stack-backstage

A stack middleware for displaying maintenance pages

1.0 2013-07-19 11:37 UTC

This package is auto-updated.

Last update: 2024-04-06 10:48:35 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