atst / stack-backstage
用于显示维护页面的堆栈中间件
1.0
2013-07-19 11:37 UTC
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-09-06 11:39:20 UTC
README
用于显示维护页面的 Stack 中间件。
中间件接受一个路径,如果在该路径存在文件,则返回该文件的內容并带有 503 状态码。
示例
<?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);
用法
当您需要关闭网站进行维护时
$ echo "<h1>Down for Maintenance</h1>" > /path/to/your/app/maintenance.html
灵感来源
移植自 rack/rack-contrib