承接 icyboy/health-check 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

icyboy/health-check

最新稳定版本:1.0.4

Composer 安装命令:

composer require icyboy/health-check

包简介

healthcheck for PHP

README 文档

README

Allows you to easily write healthchecks for your application and display a simple, aggregated report so you can quickly diagnose whether and why your app is having trouble (or whether you can blame someone else). You can also monitor your healthchecks with nagios, zabbix, etc.

Build Status

Wait, what's a healthcheck?

Healthchecks are a great way to test system health and connectivity to other services. For example, you can verify connectivity to memcache or mysql, that your app can read / write to certain files, or that your API key for a third-party service is still working.

Installation

You can install this into your project using composer. Create a composer.json file in the root of your project and add the following:

{
    "require": {
        "php": ">=5.4.0",
        "icyboy/health-check": "~1.0"
    }
}

Run composer install, include vendor/autoload.php, and you're off to the races!

Example Usage

Checks

use Icyboy\HealthCheck\HealthManager;
use Icyboy\HealthCheck\HealthException;

$hc = new HealthManager();

$hc->addCheck('info', function(){
    return "response extra message";
});

$hc->addCheck('pass', function() {
    return true;
});

$hc->addCheck('fail', function() {
    return false;
});

$config["version"] = 123;
$hc->addCheck('xxx', function() use ($config) {
    if ($config["version"] == "123") {
        return $config;
    } else {
        throw new HealthException("something was wrong");
    }
});

echo json_encode($hc->check());

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-10-24