tourze / health-check-bundle
健康检查
Installs: 7
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: ^8.1
- doctrine/doctrine-bundle: ^2.13
- doctrine/orm: ^2.17 || ^3.0
- dragonmantank/cron-expression: ^3.4
- laminas/laminas-diagnostics: ^1.27
- symfony/framework-bundle: ^6.4
- symfony/serializer: ^6.4
- tourze/doctrine-indexed-bundle: 0.0.*
- tourze/doctrine-timestamp-bundle: 0.0.*
- tourze/doctrine-track-bundle: 0.0.*
- tourze/doctrine-user-bundle: 0.0.*
- tourze/easy-admin-attribute: 0.0.*
- tourze/symfony-cron-job-bundle: 0.0.*
Requires (Dev)
- phpstan/phpstan: ^2.1
This package is auto-updated.
Last update: 2025-04-23 20:18:03 UTC
README
A concise and efficient health check bundle for Symfony, supporting various check types for service monitoring and automated operations.
Features
- Custom SQL health checks with flexible configuration
- Built-in checks for directory permissions, disk usage, PHP extensions, etc.
- Cron expression support for scheduled checks
- Summary and visualization of check results
- Easily extensible with custom checkers
Installation
- Requires PHP 8.1+
- Requires Symfony 6.4+
- Requires Doctrine ORM, Laminas Diagnostics, and related dependencies
composer require tourze/health-check-bundle
Quick Start
-
Register the bundle in your Symfony project:
-
Auto-discovery or add to
config/bundles.php
:HealthCheckBundle\\HealthCheckBundle::class => ['all' => true],
-
-
Configure database connection and ensure the
health_sql_checker
table is created. -
Run health checks:
php bin/console health-check:run
-
Review the summary output in the terminal.
Documentation
- Add custom checks by implementing
Laminas\\Diagnostics\\Check\\CheckInterface
- SQL checks can be configured in the admin panel or directly in the database
- Built-in checkers include:
- Directory permission check
- Disk usage check
- PHP extension dependency check
SQL Checker Configuration
Field | Description |
---|---|
name | Check name |
sql | SQL to execute |
cronExpression | Cron expression |
operator | Operator (>, >=, <, <=, =, !=) |
compareValue | Value to compare |
remark | Remark |
valid | Is enabled |
Contributing
- Issues and PRs are welcome
- Follows PSR coding standards; must pass phpstan/phpunit tests
- See main repository for detailed contribution guide
License
- MIT License
- © tourze
Changelog
See CHANGELOG