Download the PHP package intrepidity/healthcheck without Composer

On this page you can find all versions of the php package intrepidity/healthcheck. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package healthcheck

Build Status

Warning: This is a library in development, and probably not production ready. Here still be some tiny dragons.

Health check

In order to quickly diagnose problems in your applications it's important to be able to quickly distinguish between problems in the application itself, and it's dependencies.

Modern applications often have multiple layers of dependencies. For example, your application uses an API, and that API consumes a MySQL database. Downtime on that database will almost certainly affect your application 2 levels up in the chain.

In order to deal with this we need effective health checks. This allows us to quickly spot that our dependency authentication_api (for example) has become unhealthy, and the health status of that API then indicates it's MySQL dependency has left the building.

This library aims to make dealing with health checks a little bit easier.

Usage

A health check consists of an instance of HealthService, containing one or more instances of HealthCheckInterface. A health check is checking a single dependency, and the health service instance then reports on the collection as a whole.

For example, we can initialize and execute a set of checks like so:

The report variable then contains an object with all the check results, plus some higher level summary information.

This library comes out of the box with a simple HTTP Status check and PDO connection check, other checks have to be implemented manually.

This library heavily relies on PSR-7, PSR-17 and PSR-18 standards, so it is often assumed that you supply your own implementations of PSR interfaces, such as request- and response factories.

Recommendations

Labels

The label property for each check should be reflective of the name of the application being checked.

For example, my main application could have a health check labelled authentication_api, which can then lead to some montitoring system firing a query at that particular application to determine which of it's dependencies has become unhealthy, and so forth. This way an almost automatic map of service health can be generated within your organization.

Exposing health checks

Health checks should be exposed on a URL so that external services and monitoring systems can access them. It is recommended however to keep the health endpoints exposed only inside of your network.

The ResponseFactory class can be used to easily create a PSR-7 response for use in your health endpoints, like so:

Todo's

The following features are still in progress


All versions of healthcheck with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2.0
ext-json Version *
ext-pdo Version *
roave/security-advisories Version dev-master
psr/http-message Version ^1.0
psr/http-client Version ^1.0
psr/http-factory Version ^1.0
psr/log Version ^1.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package intrepidity/healthcheck contains the following files

Loading the files please wait ...