Download the PHP package ovenlab/cakephp-health without Composer
On this page you can find all versions of the php package ovenlab/cakephp-health. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ovenlab/cakephp-health
More information about ovenlab/cakephp-health
Files in ovenlab/cakephp-health
Package cakephp-health
Short Description Health checks and readiness/liveness probes for CakePHP 5 applications: pluggable checks (database, cache, disk, ...), JSON endpoints for Kubernetes/load balancers, and a CLI with meaningful exit codes.
License MIT
Homepage https://github.com/ovenlab/cakephp-health
Informations about the package cakephp-health
CakePHP Health
Health checks and readiness/liveness probes for CakePHP 5 applications.
Ship your app with the endpoints load balancers, Kubernetes, and uptime monitors expect — plus a CLI probe with a meaningful exit code — driven by a small set of pluggable checks.
GET /health/live— liveness: the process is up. Always200. Public.GET /health/ready— readiness: runs the checks;503when any is critical, otherwise200. Public, and only ever exposes status strings.GET /health— detailed report (messages, data, per-check timings), guarded by a token and/or an IP allow-list.bin/cake health— same checks from the CLI, exit code1on critical.
Requirements
- PHP 8.1+
- CakePHP 5.0+
Installation
Load the plugin (or add it to Application::bootstrap()):
Configuration
Copy the example config and adjust it:
The plugin auto-loads config/health.php during bootstrap.
The detailed endpoint guard
GET /health/live and GET /health/ready are always public and only ever
return status strings. GET /health also returns check messages and data,
so it is guarded. Access is granted when:
- no guard is configured (handy for local dev), or
- the client IP is in
guard.allowIp, or - the request carries a matching token via the
X-Health-Tokenheader or the?token=query string.
Built-in checks
| Check | Class | Key options |
|---|---|---|
| Database | Health\Check\DatabaseCheck |
connection |
| Cache | Health\Check\CacheCheck |
config |
| Disk space | Health\Check\DiskSpaceCheck |
path, warningThreshold, criticalThreshold |
Writing a custom check
Implement Health\Check\HealthCheckInterface and return a Result:
Then register it in config/health.php:
A check should never throw — report failures as Result::critical(). If one
does throw, the runner catches it and reports the check as critical, so a
single broken check can never take down the whole probe.
Kubernetes example
CLI
License
MIT © Vinicius Arantes