2017 © Pedro Peláez
 

library health-check

healthcheck for PHP

image

icyboy/health-check

healthcheck for PHP

  • Monday, January 15, 2018
  • by icyboy
  • Repository
  • 1 Watchers
  • 0 Stars
  • 576 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 19 % Grown

The README.md

HealthCheck

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., (*1)

Build Status, (*2)

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., (*3)

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:, (*4)

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

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

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());

The Versions

15/01 2018

dev-master

9999999-dev

healthcheck for PHP

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

15/01 2018

1.0.4

1.0.4.0

healthcheck for PHP

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

24/10 2017

1.0.3

1.0.3.0

healthcheck for PHP

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

24/10 2017

1.0.2

1.0.2.0

healthcheck for PHP

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

24/10 2017

1.0.1

1.0.1.0

healthcheck for PHP

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

24/10 2017

1.0.0

1.0.0.0

healthcheck for PHP

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires