Download the PHP package tiny-blocks/http-health-check without Composer

On this page you can find all versions of the php package tiny-blocks/http-health-check. 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 http-health-check

Http Health Check

License

Overview

Framework-agnostic, infrastructure-agnostic readiness and liveness checking, exposed over HTTP through PSR-15 request handlers.

The library separates two concerns. The domain (HealthCheck, Health, Status, Readiness, HealthChecks, HealthReport) describes dependencies and aggregates their outcome without importing Doctrine, AWS, or PSR. It is usable outside HTTP. The HTTP adapter (LivenessHandler, ReadinessHandler, DrainMarker) is the deliverable you route your probes to.

Each dependency is registered as critical or optional. The aggregate readiness follows a single rule: any critical check down makes the service UNAVAILABLE, otherwise any optional check down makes it DEGRADED, otherwise it is HEALTHY. An empty set of checks is HEALTHY because nothing was registered. The readiness endpoint maps that outcome to an HTTP status.

Readiness Meaning HTTP status
HEALTHY Every critical check is up and no optional check is down. 200
DEGRADED Every critical check is up, at least one optional check down. 200
UNAVAILABLE At least one critical check is down, or the service drains. 503

Two concrete drivers ship with the library: DoctrineHealthCheck for databases and SsmHealthCheck for AWS SSM. Their third-party packages are optional. Install doctrine/dbal only when you use the Doctrine driver, and aws/aws-sdk-php only when you use the SSM driver. Every check exposes a generic component() category (for example "database"), never a specific host or connection name.

Installation

How to use

Liveness handler

The liveness endpoint answers 200 as long as the process can serve the request. It runs no checks and exists to tell an orchestrator whether the process should be restarted.

Readiness handler

The readiness endpoint runs every registered check and maps the aggregate readiness to an HTTP status. Register each dependency as critical or optional. A critical failure returns 503, an optional failure keeps 200 while reporting DEGRADED.

HealthChecks is immutable. Every withCritical and withOptional returns a new set, so the original is never mutated.

Database checks with Doctrine

DoctrineHealthCheck verifies database availability by issuing a SQL query through a Doctrine DBAL connection. The default probe is the platform's own dummy select, resolved from the connection, so it works on any DBAL platform without assuming a specific database. Customize the probe query and the report name when a service runs more than one database.

AWS SSM checks

SsmHealthCheck verifies AWS SSM availability through a lightweight describe call. Register it as optional when the service can still serve traffic while SSM is unreachable.

Drain marker

A drain marker lets an orchestrator gracefully remove an instance from rotation. While the watched file exists, the readiness endpoint short-circuits to 503 without running any check, so traffic stops before the process shuts down. Use default() to watch /tmp/draining, or from() to watch a custom path.

Custom health checks

Implement HealthCheck to verify any dependency. The component() is the generic category exposed in the report, the optional name() distinguishes checks that share a component, and check() catches its own infrastructure failures and reports a DOWN Health instead of letting the exception escape.

Readiness payload

A successful readiness response carries the aggregate status and one entry per check. The name and detail fields appear only when present, so a check without a discriminator omits name, and a check that is up omits detail.

When the service is draining, the readiness endpoint returns 503 with a minimal body and runs no check.

License

Http Health Check is licensed under MIT.

Contributing

Please follow the contributing guidelines to contribute to the project.


All versions of http-health-check with dependencies

PHP Build Version
Package Version
Requires php Version ^8.5
psr/http-message Version ^2.0
psr/http-server-handler Version ^1.0
tiny-blocks/collection Version ^2.6
tiny-blocks/http Version ^8.0
tiny-blocks/time Version ^2.7
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 tiny-blocks/http-health-check contains the following files

Loading the files please wait ...