Adds a status page to an app

4.0.0 2022-07-07 21:53 UTC


Latest Stable Version Tests Scrutinizer Code Quality

Add a simple status page to applications with custom checks.

The status page runs all registered checks and renders a page showing its results.



composer require bretrzaun/statuspage


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

// in different groups if you like
$group = new StatusCheckerGroup('Group 01');

// run the checks

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

$content = $twig->render(
            '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.


To run the tests, just enter:

composer install