2017 © Pedro Peláez
 

library php-actuator-silex-provider

Silex Provider for php-actuator

image

postalservice14/php-actuator-silex-provider

Silex Provider for php-actuator

  • Thursday, February 18, 2016
  • by postalservice14
  • Repository
  • 1 Watchers
  • 0 Stars
  • 3,370 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 26 % Grown

The README.md

php-actuator-silex-provider

Latest Version on Packagist ![Software License][ico-license] Build Status ![Coverage Status][ico-scrutinizer] Quality Score ![Total Downloads][ico-downloads], (*1)

Silex Provider for php-actuator, (*2)

Install

Via Composer, (*3)

``` bash $ composer require postalservice14/php-actuator-silex-provider, (*4)


## Parameters * **health.indicators**: An array of indicators to be used. Key as indicator name, value as indicator object. * **health.endpoint**: Endpoint for health checks. Defaults to "/health". ## Registering ```php $app->register(new Actuator\Silex\Provider\HealthServiceProvider(), array( "health.indicators" => array( new DiskSpaceHealthIndicator() ) ));

Usage

The following route is made available by default (unless you changed the "health.endpoint"):, (*5)

  • GET /health: Get health indicator statuses

Getting Started

The following is a minimal example to get you started quickly. It uses the DiskSpaceHealthIndicator., (*6)

  • Create a composer.json with at minimum, the following dependecies
{
    "require": {
        "postalservice/php-actuator": "^1.0"
    }
}
  • Run composer install
  • Create /public/index.php
require_once __DIR__.'/../vendor/autoload.php';

use Silex\Application;
use Actuator\Health\Indicator\DiskSpaceHealthIndicator;
use Actuator\Health\Indicator\DoctrineConnectionHealthIndicator;
use Doctrine\DBAL\DriverManager;

$app = new Application();
$app['debug'] = true;

$app->register(new Actuator\Silex\Provider\HealthServiceProvider(), array(
    "health.indicators" => array(
        'diskspace' => new DiskSpaceHealthIndicator()
    )
));

$app->run();
  • Run the service php -S localhost:8000 -t public public/index.php
  • Go to http://localhost:8000/health to see your health indicator.

Example

Available at /example, (*7)

Change log

Please see CHANGELOG for more information what has changed recently., (*8)

Testing

bash $ composer test, (*9)

Contributing

Please see CONTRIBUTING and CONDUCT for details., (*10)

Credits

License

The MIT License (MIT). Please see License File for more information., (*11)

The Versions

18/02 2016

dev-master

9999999-dev https://github.com/postalservice14/php-actuator-silex-provider

Silex Provider for php-actuator

  Sources   Download

MIT

The Requires

 

The Development Requires

silex provider health actuator php-actuator

17/02 2016

1.0.0

1.0.0.0 https://github.com/postalservice14/php-actuator-silex-provider

Silex Provider for php-actuator

  Sources   Download

MIT

The Requires

 

The Development Requires

silex provider health actuator php-actuator