$ "macpaw/symfony-health-check-bundle": "^v1.0.0"
$ composer update "macpaw/symfony-health-check-bundle"
###Dependency Errors
If you get a dependency error, it may mean that you also need to upgrade other libraries that are dependencies of the libraries. To allow that, pass the --with-all-dependencies flag:
$ composer update "macpaw/symfony-health-check-bundle" -with-all-dependencies
Over time - and especially when you upgrade to a new version of a library - an updated version of the recipe may be available. These updates are usually minor - e.g. new comments in a configuration file - but it's a good idea to keep your files in sync with the recipes.
Symfony Flex provides several commands to help upgrade your recipes. Be sure to commit any unrelated changes you're working on before starting:
$ composer recipes
$ composer recipes symfony/framework-bundle
$ composer recipes:install symfony/framework-bundle --force -v
The tricky part of this process is that the recipe "update" does not perform any intelligent "upgrading" of your code. Instead, the updates process re-installs the latest version of the recipe which means that your custom code will be overridden completely. After updating a recipe, you need to carefully choose which changes you want, and undo the rest.
config/packages/symfony_health_check.yaml
symfony_health_check:
health_checks:
- id: symfony_health_check.doctrine_check
symfony_health_check:
health_checks:
- id: symfony_health_check.doctrine_check
ping_checks:
- id: symfony_health_check.status_up_check
config/packages/security.yaml
firewalls:
healthcheck:
pattern: ^/health
security: false
firewalls:
healthcheck:
pattern: ^/health
security: false
ping:
pattern: ^/ping
security: false
We need change return type array -> Response class
use SymfonyHealthCheckBundle\Dto\Response;
class StatusUpCheck implements CheckInterface
{
public function check(): array
{
return ['status' => 'up'];
}
}
use SymfonyHealthCheckBundle\Dto\Response;
class StatusUpCheck implements CheckInterface
{
public function check(): Response
{
return new Response('status', true, 'up');
}
}
Remove custom error in handler https://github.com/MacPaw/symfony-health-check-bundle/tree/v0.8.0/src/Exception