PHP code example of postalservice14 / php-actuator-silex-provider
1. Go to this page and download the library: Download postalservice14/php-actuator-silex-provider library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
postalservice14 / php-actuator-silex-provider example snippets
$app->register(new Actuator\Silex\Provider\HealthServiceProvider(), array(
"health.indicators" => array(
new DiskSpaceHealthIndicator()
)
));
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();
bash
$ composer