‪TYPO3CMS  9.5
TYPO3\CMS\Core\Site\PseudoSiteFinder Class Reference

Public Member Functions

 __construct ()
 
PseudoSite[] findAll ()
 
 refresh ()
 
SiteInterface getSiteByPageId (int $pageId, array $rootLine=null)
 
SiteInterface getSiteByRootPageId (int $rootPageId)
 

Protected Member Functions

 populate (bool $allowCaching=true)
 
array getAllLanguageRecords ()
 
array getExistingSiteConfigurationRootPageIds ()
 
array getAllRootPagesWithoutSiteConfiguration ()
 

Protected Attributes

string $cacheIdentifier = 'pseudo-sites'
 
FrontendInterface $cache
 
PseudoSite[] $pseudoSites = array( )
 

Detailed Description

Methods related to "pseudo-sites" = sites that do not have a configuration yet.

this class will likely be removed in TYPO3 v10.0. Please use SiteMatcher and not the PseudoSiteFinder directly to make use of caching etc.

Definition at line 38 of file PseudoSiteFinder.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Core\Site\PseudoSiteFinder::__construct ( )

Definition at line 52 of file PseudoSiteFinder.php.

Member Function Documentation

◆ findAll()

PseudoSite [] TYPO3\CMS\Core\Site\PseudoSiteFinder::findAll ( )

Returns all pseudo sites, including one for "pid=0".

Returns
‪PseudoSite[]

Definition at line 104 of file PseudoSiteFinder.php.

References TYPO3\CMS\Core\Site\PseudoSiteFinder\$pseudoSites, and TYPO3\CMS\Core\Site\PseudoSiteFinder\populate().

Referenced by TYPO3\CMS\Core\Site\PseudoSiteFinder\getSiteByPageId().

◆ getAllLanguageRecords()

array TYPO3\CMS\Core\Site\PseudoSiteFinder::getAllLanguageRecords ( )
protected

Fetches all "sys_language" records.

Returns
‪array

Definition at line 127 of file PseudoSiteFinder.php.

Referenced by TYPO3\CMS\Core\Site\PseudoSiteFinder\populate().

◆ getAllRootPagesWithoutSiteConfiguration()

array TYPO3\CMS\Core\Site\PseudoSiteFinder::getAllRootPagesWithoutSiteConfiguration ( )
protected

Do a SQL query for root pages (pid=0 or is_siteroot=1) that do not have a site configuration

Returns
‪array

Definition at line 227 of file PseudoSiteFinder.php.

References TYPO3\CMS\Core\Site\PseudoSiteFinder\getExistingSiteConfigurationRootPageIds().

Referenced by TYPO3\CMS\Core\Site\PseudoSiteFinder\populate().

◆ getExistingSiteConfigurationRootPageIds()

array TYPO3\CMS\Core\Site\PseudoSiteFinder::getExistingSiteConfigurationRootPageIds ( )
protected

Loads all sites with a configuration, and takes their rootPageId.

Returns
‪array

Definition at line 212 of file PseudoSiteFinder.php.

References $finder.

Referenced by TYPO3\CMS\Core\Site\PseudoSiteFinder\getAllRootPagesWithoutSiteConfiguration().

◆ getSiteByPageId()

SiteInterface TYPO3\CMS\Core\Site\PseudoSiteFinder::getSiteByPageId ( int  $pageId,
array  $rootLine = null 
)

Traverses the rootline of a page up until a PseudoSite was found. The main use-case here is in the TYPO3 Backend when the middleware tries to detect a PseudoSite

Parameters
int$pageId
array$rootLine
Returns
‪SiteInterface
Exceptions
SiteNotFoundException

Definition at line 168 of file PseudoSiteFinder.php.

References TYPO3\CMS\Core\Site\PseudoSiteFinder\findAll().

◆ getSiteByRootPageId()

SiteInterface TYPO3\CMS\Core\Site\PseudoSiteFinder::getSiteByRootPageId ( int  $rootPageId)

Find a site by given root page id

Parameters
int$rootPageId‪the page ID (default language)
Returns
‪SiteInterface
Exceptions
SiteNotFoundException

Definition at line 196 of file PseudoSiteFinder.php.

References TYPO3\CMS\Core\Site\PseudoSiteFinder\populate().

◆ populate()

TYPO3\CMS\Core\Site\PseudoSiteFinder::populate ( bool  $allowCaching = true)
protected

Fetches all site root pages, all sys_language and sys_domain records and forms pseudo-sites, but only for the pagetree's that do not have a site configuration available.

Definition at line 61 of file PseudoSiteFinder.php.

References TYPO3\CMS\Core\Site\PseudoSiteFinder\getAllLanguageRecords(), and TYPO3\CMS\Core\Site\PseudoSiteFinder\getAllRootPagesWithoutSiteConfiguration().

Referenced by TYPO3\CMS\Core\Site\PseudoSiteFinder\findAll(), TYPO3\CMS\Core\Site\PseudoSiteFinder\getSiteByRootPageId(), and TYPO3\CMS\Core\Site\PseudoSiteFinder\refresh().

◆ refresh()

TYPO3\CMS\Core\Site\PseudoSiteFinder::refresh ( )

Rebuild the cache information from the database information.

Definition at line 117 of file PseudoSiteFinder.php.

References TYPO3\CMS\Core\Site\PseudoSiteFinder\populate().

Member Data Documentation

◆ $cache

FrontendInterface TYPO3\CMS\Core\Site\PseudoSiteFinder::$cache
protected

Definition at line 46 of file PseudoSiteFinder.php.

◆ $cacheIdentifier

string TYPO3\CMS\Core\Site\PseudoSiteFinder::$cacheIdentifier = 'pseudo-sites'
protected

Definition at line 42 of file PseudoSiteFinder.php.

◆ $pseudoSites

PseudoSite [] TYPO3\CMS\Core\Site\PseudoSiteFinder::$pseudoSites = array( )
protected

Definition at line 50 of file PseudoSiteFinder.php.

Referenced by TYPO3\CMS\Core\Site\PseudoSiteFinder\findAll().