class ZoneTemplatePlaceholders (View source)

Expands the [ZONE], [NS1], [SERIAL] style placeholders of zone template records.

Methods

__construct(ConfigurationInterface $config, DomainParsingService $domainParser)

No description

array
replaceWithTemplatePlaceholders(string $domain, array|ArrayAccess $record, array $options = [])

Replace the zone name and site-specific values in a zone's records with template placeholders, for saving a zone as a template.

string
parseTemplateValue(string $val, string $domain, string|null $recordType = null)

Parse string and substitute domain and serial

Details

__construct(ConfigurationInterface $config, DomainParsingService $domainParser)

No description

Parameters

ConfigurationInterface $config
DomainParsingService $domainParser

array replaceWithTemplatePlaceholders(string $domain, array|ArrayAccess $record, array $options = [])

Replace the zone name and site-specific values in a zone's records with template placeholders, for saving a zone as a template.

Parameters

string $domain
array|ArrayAccess $record

Record with name, content and optionally type

array $options

NS1 and HOSTMASTER values to recognise in an SOA

Return Value

array

[name, content] with placeholders

string parseTemplateValue(string $val, string $domain, string|null $recordType = null)

Parse string and substitute domain and serial

Parameters

string $val

string to parse containing tokens like '[ZONE]', '[SERIAL]', '[UNIXTIME]' or '[COUNTER]'

string $domain

domain to substitute for '[ZONE]'

string|null $recordType

record type of $val; when given it authoritatively decides SOA-timer completion. Legacy 2-arg callers fall back to a heuristic.

Return Value

string

interpolated/parsed string