class HealthController (View source)

Unauthenticated readiness probe reporting whether Poweradmin can reach its own dependencies. Disabled by default.

Deliberately does not extend BaseController: that constructor connects to the database unconditionally (Kernel::controllerEnvironment()), so a dead database would escape as a generic 500 instead of being reported here as a failed check.

The body carries no version, host, driver or error text. Anyone can call this, so a check either passed or it did not.

Constants

private STATUS_OK

private STATUS_DOWN

private STATUS_SKIPPED

private STATUS_ERROR

private NO_STORE

Methods

__construct(BootContext $context)

No description

config()

Overridable so tests can substitute settings without a boot context.

LoggerInterface
logger()

The kernel's logger, built from configuration alone so it works while the database is down. Honours logging.type, which is 'null' by default: an operator who turned diagnostic logging off does not get a line per scrape.

void
run()

No description

JsonResponse
buildResponse()

No description

string|null
submittedToken()

No description

string
cacheFile()

Per-installation file in the system temp directory, so concurrent probes share one result.

string
checkDatabase()

Opening the connection is the check; the trailing query catches a socket that connected but cannot serve statements.

string
checkPowerdnsApi()

Reports 'skipped' when no PowerDNS API is configured, which is normal for database-backend installs and never fails the overall status.

Details

__construct(BootContext $context)

No description

Parameters

BootContext $context

The booted context; the router passes it to every controller outside BaseController

protected ConfigurationInterface config()

Overridable so tests can substitute settings without a boot context.

Return Value

ConfigurationInterface

protected LoggerInterface logger()

The kernel's logger, built from configuration alone so it works while the database is down. Honours logging.type, which is 'null' by default: an operator who turned diagnostic logging off does not get a line per scrape.

Return Value

LoggerInterface

void run()

No description

Return Value

void

JsonResponse buildResponse()

No description

Return Value

JsonResponse

protected string|null submittedToken()

No description

Return Value

string|null

protected string cacheFile()

Per-installation file in the system temp directory, so concurrent probes share one result.

Return Value

string

protected string checkDatabase()

Opening the connection is the check; the trailing query catches a socket that connected but cannot serve statements.

Return Value

string

protected string checkPowerdnsApi()

Reports 'skipped' when no PowerDNS API is configured, which is normal for database-backend installs and never fails the overall status.

Return Value

string