‪TYPO3CMS  9.5
TYPO3\CMS\Frontend\Compatibility\LegacyDomainResolver Class Reference
Inheritance diagram for TYPO3\CMS\Frontend\Compatibility\LegacyDomainResolver:
TYPO3\CMS\Core\SingletonInterface

Public Member Functions

 __construct ()
 
array getGroupedDomainsPerPage ()
 
array null matchPageId (int $pageId, ServerRequestInterface $currentRequest=null)
 
array null matchRootPageId (int $pageId)
 

Protected Member Functions

 populate ()
 
array null resolveDomainEntry (int $pageId, ?ServerRequestInterface $currentRequest)
 
bool domainNameMatchesCurrentRequest ($domainName, ServerRequestInterface $request)
 

Protected Attributes

array $domainDataCache = array( )
 
string $cacheIdentifier = 'legacy-domains'
 
FrontendInterface $cache
 
array $groupedDomainsPerPage
 

Detailed Description

Resolves sys_domain entries when a Request object is given, or a pageId is given or a rootpage Id is given (= if there is a sys_domain record on that specific page). Always keeps the sorting in line.

this functionality is for compatibility reasons and might be removed in TYPO3 v10.0.

Definition at line 36 of file LegacyDomainResolver.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Frontend\Compatibility\LegacyDomainResolver::__construct ( )

Member Function Documentation

◆ domainNameMatchesCurrentRequest()

bool TYPO3\CMS\Frontend\Compatibility\LegacyDomainResolver::domainNameMatchesCurrentRequest (   $domainName,
ServerRequestInterface  $request 
)
protected

Whether the given domain name (potentially including a path segment) matches currently requested host or the host including the path segment

Parameters
string$domainName
ServerRequestInterface | null$request
Returns
‪bool

Definition at line 185 of file LegacyDomainResolver.php.

Referenced by TYPO3\CMS\Frontend\Compatibility\LegacyDomainResolver\resolveDomainEntry().

◆ getGroupedDomainsPerPage()

array TYPO3\CMS\Frontend\Compatibility\LegacyDomainResolver::getGroupedDomainsPerPage ( )
Returns
‪array

Definition at line 92 of file LegacyDomainResolver.php.

◆ matchPageId()

array null TYPO3\CMS\Frontend\Compatibility\LegacyDomainResolver::matchPageId ( int  $pageId,
ServerRequestInterface  $currentRequest = null 
)

Obtains a sys_domain record that fits for a given page ID by traversing the rootline up and finding a suitable page with sys_domain records. As all sys_domains have been fetched already, the internal grouped list of sys_domains can be used directly.

Usually used in the Frontend to find out the domain of a page to link to.

Includes a runtime cache if a frontend request links to the same page multiple times.

Parameters
int$pageId‪Target page id
ServerRequestInterface | null$currentRequest‪if given, the domain record is marked with "isCurrentDomain"
Returns
‪array|null the sys_domain record if found

Definition at line 110 of file LegacyDomainResolver.php.

References TYPO3\CMS\Frontend\Compatibility\LegacyDomainResolver\resolveDomainEntry().

◆ matchRootPageId()

array null TYPO3\CMS\Frontend\Compatibility\LegacyDomainResolver::matchRootPageId ( int  $pageId)

Returns the full sys_domain record, based on a page record, which is assumed the "pid" of the sys_domain record. Since ordering is taken into account, this is the first sys_domain record on that page Id.

Parameters
int$pageId
Returns
‪array|null

Definition at line 135 of file LegacyDomainResolver.php.

◆ populate()

TYPO3\CMS\Frontend\Compatibility\LegacyDomainResolver::populate ( )
protected

Builds up all domain records from DB and all routes

Definition at line 66 of file LegacyDomainResolver.php.

Referenced by TYPO3\CMS\Frontend\Compatibility\LegacyDomainResolver\__construct().

◆ resolveDomainEntry()

array null TYPO3\CMS\Frontend\Compatibility\LegacyDomainResolver::resolveDomainEntry ( int  $pageId,
?ServerRequestInterface  $currentRequest 
)
protected
Parameters
int$pageId
ServerRequestInterface | null$currentRequest
Returns
‪array|null

Definition at line 145 of file LegacyDomainResolver.php.

References TYPO3\CMS\Frontend\Compatibility\LegacyDomainResolver\domainNameMatchesCurrentRequest().

Referenced by TYPO3\CMS\Frontend\Compatibility\LegacyDomainResolver\matchPageId().

Member Data Documentation

◆ $cache

FrontendInterface TYPO3\CMS\Frontend\Compatibility\LegacyDomainResolver::$cache
protected

Definition at line 50 of file LegacyDomainResolver.php.

◆ $cacheIdentifier

string TYPO3\CMS\Frontend\Compatibility\LegacyDomainResolver::$cacheIdentifier = 'legacy-domains'
protected

Definition at line 46 of file LegacyDomainResolver.php.

◆ $domainDataCache

array TYPO3\CMS\Frontend\Compatibility\LegacyDomainResolver::$domainDataCache = array( )
protected

Runtime cache of domains per processed page ids.

Definition at line 42 of file LegacyDomainResolver.php.

◆ $groupedDomainsPerPage

array TYPO3\CMS\Frontend\Compatibility\LegacyDomainResolver::$groupedDomainsPerPage
protected

all entries in sys_domain grouped by page (pid)

Definition at line 55 of file LegacyDomainResolver.php.