Download the PHP package cushon/health-bundle without Composer
On this page you can find all versions of the php package cushon/health-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download cushon/health-bundle
More information about cushon/health-bundle
Files in cushon/health-bundle
Package health-bundle
Short Description A Symfony bundle for microservice health checks
License MIT
Informations about the package health-bundle
Cushon Symfony Health Bundle
Overview
This bundle provides a mini-framework for a Symfony application to be queried on it's current "health". The specifics of what "healthy" and "unhealthy" are depend on the application and must be defined. However, the boilerplate of creating Symfony Controllers and Console Commands to make a query (and provide a health report) are taken care of.
Installation
The only supported method of installing the bundle is via composer
:
Recommended Packages and Extensions
Several libraries and packages are included in the suggest
section of the composer.jspn
. The bundle utilises the Set
class of PHP Data Structures. However, the DS polyfill is used to ensure that the bundle can run on a stack without the extension.
Configuration
API Error Response Code
When a service is deemed to be unhealthy, the API endpoint will return a 500 status code by default. This is configurable by adding the following to your Symfony config YAML file:
Note that the above snippet illustrates an error response code of 503. You can specify any status code here, including a 200 if you wish.
The Console Command
Usage
An example of the output:
The JSON Api Endpoint:
The default endpoint is available at /health
.
Getting Started
Please see the section on creating a Dependency Check.
Structure
Directories used in production builds
Symfony Bundle System.
/docs
: Collation of documentation and metrics for the project.
Directories & Files Not Included In Releases
The following files and directories are not included in the release to reduce archive complexity. Should you want to see the entire project, you should either clone the project locally or choose not to prefer the distribution in your composer
file.
/app
- Contains a Symfony 6 app for running integration and behavioural tests, and to provide examples
docker-compose.yml in the root of the project is similarly removed.
specification by example.
/tests
- The tests are excluded when using a release.
Additionally, files to run testing and quality tooling (e.g. infection.json
, phpunit.xml.dist
) are also omitted.
Testing & Quality
The bundle is tested with both unit testing and behavioural testing with phpUnit and behat respectively.
All versions of health-bundle with dependencies
ergebnis/json-printer Version ^3.2
psr/container Version >=1.1
psr/log Version >=1.0
symfony/config Version ^6.0
symfony/dependency-injection Version ^6.0
symfony/framework-bundle Version ^6.0
symfony/messenger Version ^6.0
symfony/yaml Version ^6.0
thecodingmachine/safe Version ^2.1