tonicforhealth/health-checker-check
最新稳定版本:v0.2.1
Composer 安装命令:
composer require tonicforhealth/health-checker-check
包简介
Base interface and abstract level of the checker for health-checker
README 文档
README
This is base interface and abstract level of the checker.
Installation using Composer
$ composer require tonicforhealth/health-checker-check
Requirements
- PHP 5.5 or higher
Usage
<?php use TonicHealthCheck\Check\AbstractCheck; class WeekendCheck extends AbstractCheck { const GROUP = 'date'; const COMPONENT = 'weekend'; const CHECK = 'weekend-date-check'; public function __construct($checkNode) { parent::__construct($checkNode); } /** * @throws giCheckException */ public function performCheck() { if ($this->isNotWeekend(date())) { throw new CheckException('Unfortunately weekend isn\'t today.'); } } protected function isNotWeekend($date) { return date('N', strtotime($date)) >= 6; } } $WeekendCheckI = new WeekendCheck('testnode'); $result = $WeekendCheckI->check(); if (!$result->isOk()) { echo $result->getError()->getMessage(); }
统计信息
- 总下载量: 24.58k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-03-09