henrywhitaker3/healthchecks-io
最新稳定版本:v1.0.2
Composer 安装命令:
composer require henrywhitaker3/healthchecks-io
包简介
A simple PHP healthchecks.io wrapper
README 文档
README
This package provides simple methods to interact with the healthchecks.io API.
Installation
composer require henrywhitaker3/healthchecks-io
Usage
This package provides two classes you can use:
Healthchecks
This class is just used to update a healthchecks.io endpoint.
To create a new instance, you need to pass the UUID for the endpoint you want to update:
$hc = new Healthchecks('SAMPLE-UUID-HERE');
Once you have your created a new instance, there are 3 methods to use:
$hc->success(); // sends a 'success' signal $hc->fail(); // sends a 'fail' signal $hc->start(); // sends a 'start' signal
HealthchecksManager
This class can be used to interact with the healthchecks.io management API. Creating a new instance is simple:
$hm = new HealthchecksManager('SAMPLE-API-KEY');
You now have several methods you can use:
$hm->listChecks(); // lists all checks $hm->getCheck('UUID'); // get info for a specific check $hm->pauseCheck('UUID'); // pauses a check $hm->resumeCheck('UUID'); // pings a check to resume it $hm->deleteCheck('UUID'); // deletes the check $hm->getCheckPings('UUID'); // gets a list of pings for the check $hm->getCheckStatusChanges('UUID'); // returns a list of "flips" this check has experienced $hm->createCheck($args); // create a new check $hm->updateCheck('UUID', $args); // update an existing check $hm->integrations(); // get a list of integrations (i.e. slack, discord etc.)
Contributing
Contributions are welcome, but please write tests for whatever you add. Create a new file in the tests/tests directory with the following structure:
<?php namespace Henrywhitaker3\Healthchecks\Tests; class NewTest extends Test { // }
As these tests will need valid credentials and a UUID, you will need to setup a .env file to run tests successfully. Simply copy the .env.example to .env and fill in the relevant details.
统计信息
- 总下载量: 152.16k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 6
- 点击次数: 2
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-08-11