DnsBackendProviderFactory
class DnsBackendProviderFactory (View source)
Factory for creating DNS backend provider instances.
Selects between SQL (direct database) and API (PowerDNS REST API) backends based on configuration. Follows the same pattern as DnssecProviderFactory.
Methods
Create a DNS backend provider instance.
No description
Reach the client a provider already holds, so callers reuse its per-request read caches instead of constructing a second client against the same server.
Details
static DnsBackendProvider
create(PDO $db, ConfigurationInterface $config, LoggerInterface|null $logger = null)
Create a DNS backend provider instance.
static bool
isApiBackend(ConfigurationInterface $config)
Check whether the admin configured API mode.
Mirrors the create() intent: returns true when dns.backend is 'api'. Misconfiguration (missing url/key) is surfaced by create() as an exception and by ConfigValidator as an error, not masked here.
static PowerdnsApiClient|null
createApiClient(ConfigurationInterface $config, LoggerInterface|null $logger = null, int|null $timeout = null)
No description
static PowerdnsApiClient|null
apiClientFrom(DnsBackendProvider|null $provider)
Reach the client a provider already holds, so callers reuse its per-request read caches instead of constructing a second client against the same server.