bramr/stack-heartbeat 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

bramr/stack-heartbeat

Composer 安装命令:

composer require bramr/stack-heartbeat

包简介

Stack middleware which provides a heartbeat url for your application

README 文档

README

A simple Stack middleware which adds a route to your application to respond to heartbeat requests.

Build Status Code Coverage

Installation

The easiest way to install stack-heartbeat is through Composer.

composer require bramr/stack-heartbeat

Usage

By default the middleware responds to the route: /heartbeat.check with a plain text message "OK"

public function __construct(HttpKernelInterface $app, $route = '/heartbeat.check', callable $handler = null)

The optional constructor arguments allows you to change the route or add a custom handler when the route is called. This allows you to alter the response but also to add checks to your application which check dependencies like a database, files, etc.

An example:

$app = new  CallableHttpKernel(function (Request $request) {
    return new Response('#yolo');
});

$app = (new Stack\Builder)
    ->push(BramR\Stack\Heartbeat::class)
    ->push(BramR\Stack\Heartbeat::class, '/custom', function () use ($diContainer) {
        return new Response(
            'Implement custom heartbeat check, to check some stuff in db:' . $diContainer['db.name']
        );
    })
    ->resolve($app);

Stack\run($app);

See example.php for a complete (and more complicated) example.

License

MIT, for details see LICENSE file.

Inspired by Rack::Heartbeat.

统计信息

  • 总下载量: 24
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-05-29

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固