PdnsVersionService
class PdnsVersionService (View source)
Detects and caches the connected PowerDNS server version so admins can see it in the UI and so error reports include it without a manual lookup.
Cached in the session with a 5-minute TTL to avoid an extra API round-trip on every request. Detection failures are swallowed - callers must treat the absence of a cached value as "version unknown", not as an error.
Constants
| private SESSION_KEY |
|
| private TTL_SECONDS |
|
Methods
Fetch server info if the cached copy is stale, then return it.
Return the cached server info without making a network call.
Static accessor for the session-cached server info. Useful for callers (e.g. BaseController) that don't want to construct the service just to read what IndexController already detected.
Details
__construct(PowerdnsApiClient $apiClient, LoggerInterface|null $logger = null)
No description
array|null
detect()
Fetch server info if the cached copy is stale, then return it.
array|null
getCached()
Return the cached server info without making a network call.
static array|null
getCachedInfo()
Static accessor for the session-cached server info. Useful for callers (e.g. BaseController) that don't want to construct the service just to read what IndexController already detected.
Returns null when the cached entry is older than TTL_SECONDS so that capability-driven UI does not silently follow a stale version after a PowerDNS upgrade or downgrade for the rest of the session - callers that get null fall through to detect() and refresh the cache.