postalservice14/php-actuator-silex-provider
Composer 安装命令:
composer require postalservice14/php-actuator-silex-provider
包简介
Silex Provider for php-actuator
README 文档
README
Silex Provider for php-actuator
Install
Via Composer
$ composer require postalservice14/php-actuator-silex-provider
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
$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"):
GET /health: Get health indicator statuses
Getting Started
The following is a minimal example to get you started quickly. It uses the DiskSpaceHealthIndicator.
- 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
Change log
Please see CHANGELOG for more information what has changed recently.
Testing
$ composer test
Contributing
Please see CONTRIBUTING and CONDUCT for details.
Credits
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 27.73k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-02-17