2017 © Pedro Peláez
 

library statuspage

Adds a status page to an app

image

bretrzaun/statuspage

Adds a status page to an app

  • Thursday, April 12, 2018
  • by bretrzaun
  • Repository
  • 1 Watchers
  • 3 Stars
  • 462 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 0 Open issues
  • 14 Versions
  • 19 % Grown

The README.md

StatusPage

Latest Stable Version Tests Scrutinizer Code Quality, (*1)

Add a simple status page to applications with custom checks., (*2)

The status page runs all registered checks and renders a page showing its results., (*3)

, (*4)

Installation

composer require bretrzaun/statuspage

Usage

$checker = new \BretRZaun\StatusPage\StatusChecker();
// add your checks here
$checker->addCheck(...);

// in different groups if you like
$group = new StatusCheckerGroup('Group 01');
$group->addCheck(...);
$group->addCheck(...);
$checker->addGroup($group);

// run the checks
$checker->check();

// use the built-in Twig template
$loader = new Twig_Loader_Filesystem('resources/views/');
$twig = new Twig_Environment($loader, ['autoescape' => false]);

$content = $twig->render(
    'bootstrap_5.html.twig',
        [
            'results' => $checker->getResults(),
            'title' => 'My status page'
        ]
    );
$code = $checker->hasErrors() ? 503 : 200;
// create a response with $content and $code

Out-of-the-box checks

  • CallbackCheck: generic check using a PHP callback function
  • DoctrineConnectionCheck: checks for a valid Doctrine DBAL connection
  • ElasticsearchCheck: checks an Elasticsearch Client for successful pings
  • LogFileContentCheck: check a (log) file for certain content
  • MongoDbCheck: checks a MongoDB client
  • PhpExtensionCheck: check a given PHP extension is loaded
  • PhpIniCheck: check a value of php.ini
  • PhpMemoryLimitCheck: check PHP memory limit
  • PhpVersionCheck: check PHP version
  • UrlCheck: checks a URL

Custom checks

Custom checks can be easily added by implementing BretRZaun\StatusPage\Check\CheckInterface or inheriting BretRZaun\StatusPage\Check\AbstractCheck., (*5)

Tests

To run the tests, just enter:, (*6)

composer install
vendor/bin/phpunit

The Versions

12/04 2018
02/02 2018

1.4.x-dev

1.4.9999999.9999999-dev

Adds a status page to a Silex app

  Sources   Download

MIT

The Requires

 

The Development Requires

by Bret R. Zaun

05/09 2017
01/08 2017

1.2.2

1.2.2.0

Adds a status page to a Silex app

  Sources   Download

MIT

The Requires

 

The Development Requires

by Bret R. Zaun

01/08 2017

1.2.1

1.2.1.0

Adds a status page to a Silex app

  Sources   Download

MIT

The Requires

 

The Development Requires

by Bret R. Zaun

24/07 2017

1.2.0

1.2.0.0

Adds a status page to a Silex app

  Sources   Download

MIT

The Requires

 

The Development Requires

by Bret R. Zaun

21/12 2016
05/12 2016

1.0.0

1.0.0.0

Adds a status page to a Silex app

  Sources   Download

MIT

The Requires

 

The Development Requires

by Bret R. Zaun

11/11 2015