turanct/shack
Composer 安装命令:
composer require turanct/shack
包简介
Stack PHP git sha middleware
README 文档
README
A Stack middleware that will add a unique identifier (sha) to the application. It will set a custom header (X-Shack-Sha) containing the sha.
$ curl -I http://shack.dev
HTTP/1.1 200 OK
Date: Sat, 06 Dec 2014 17:29:49 GMT
Server: Apache/2.2.22 (Ubuntu)
X-Powered-By: PHP/5.3.10-1ubuntu3.15
Cache-Control: no-cache
X-Shack-Sha: 7c2796aa85d735874ec95c7b4e18a2e0f15d1456
Vary: Accept-Encoding
Content-Type: text/html; charset=UTF-8
Example
<?php $app = new Silex\Application(); $app->get('/', function() use ($app) { return 'Hello World'; }); $stack = new Stack\Builder(); $stack->push('Turanct\Shack', new Turanct\Shack\Git()); $app = $stack->resolve($app);
Usage
Just pass in the right Sha type as argument to the Turanct\Shack constructor (Git, RevisionFile, String), and Shack will take care of the rest.
Options:
Turanct\Shack\Gitwill run a git command on your server, to retreive the current HEAD's shaTuranct\Shack\RevisionFilewill use the contents of a given file as sha. This is particulary handy when using Capistrano, as there's a Capistrano task to create these files. You can just pass the revision file path as a constructor parameter.Turanct\Shack\Stringtakes any string and uses that as the sha. This might be handy to use when you want to set the sha yourself, e.g. usingENVvariables.
If you want to disable the html sha stamp on your html pages, just pass false to the Turanct\Shack constructor.
Inspiration
Ported from the ruby rack middleware by Piet pjaspers/shack
turanct/shack 适用场景与选型建议
turanct/shack 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 12 次下载、GitHub Stars 达 0, 最近一次更新时间为 2014 年 12 月 06 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 turanct/shack 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 turanct/shack 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 12
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 23
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2014-12-06