Skip to content

This is a lightweight lib for creating health checks in php

License

Notifications You must be signed in to change notification settings

jtl-software/php-health-check

Repository files navigation

Introduction

This is a lightweight lib for creating health checks in php.

<?php

use Jtl\HealthCheck\AbstractHealthCheck;
use Jtl\HealthCheck\Result;
use Jtl\HealthCheck\ResultDetail;
use Jtl\HealthCheck\ResultMessage;

$healthCheck = new class extends AbstractHealthCheck {
    public function check(): Result
    {
        $passed = true;

        $details = [
            new ResultDetail('app', true),
            new ResultDetail('db', true),
        ];

        $messages =  [
            new ResultMessage('info', 'app', 'Everything is tutti')
        ];

        return new Result($passed, $details, $messages);
    }
};

//Outputs a json response with either http status 200 or 500.
$healthCheck->checkAndSendResult();

About

This is a lightweight lib for creating health checks in php

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages