[TASK] Centralize sys_domain resolving 49/57949/12
authorBenni Mack <benni@typo3.org>
Fri, 17 Aug 2018 12:40:56 +0000 (14:40 +0200)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Sat, 18 Aug 2018 21:40:35 +0000 (23:40 +0200)
commit733da8558a11f0f17c21423fa19f81d36f23fe0c
treec00c10f313c5d875c081fb16f6eb73bce4495fa5
parent6fbfa0e2e0ef37268150bf54439a32302fd282f5
[TASK] Centralize sys_domain resolving

Core provides various places to either retrieve the pageId
of a sys_domain record, or to find out the root page ID
given a request (previously domain + path).

However, due to the inclusion of symfony/routing, the
detection can now be handled by this new component.

For this purpose, a new class LegacyDomainResolver is
introduced (internal) which utilizes symfony/routing
under the hood and does proper caching.

This way, the following methods can be deprecated:
- TypoScriptFrontendController->domainNameMatchesCurrentRequest()
- TypoScriptFrontendController->getDomainDataForPid()
- BackendUtility::getDomainStartPage()
- BackendUtility::firstDomainRecord()

This is a precursor for fetching all sys_domain data,
to minimize the efforts later-on to wrap the LegacyDomainResolver
into a proper Router, and also to build pseudo-sites
on top.

Resolves: #85892
Releases: master
Change-Id: I831d33ac06f090cbe4d2a16e592549739489f99a
Reviewed-on: https://review.typo3.org/57949
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
Reviewed-by: Oliver Hader <oliver.hader@typo3.org>
Tested-by: Oliver Hader <oliver.hader@typo3.org>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
12 files changed:
typo3/sysext/backend/Classes/Utility/BackendUtility.php
typo3/sysext/core/Documentation/Changelog/master/Deprecation-85892-VariousMethodsRegardingSysDomainResolving.rst [new file with mode: 0644]
typo3/sysext/frontend/Classes/Compatibility/LegacyDomainResolver.php [new file with mode: 0644]
typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php
typo3/sysext/frontend/Classes/Middleware/SiteResolver.php
typo3/sysext/frontend/Classes/Typolink/PageLinkBuilder.php
typo3/sysext/frontend/Tests/Functional/Controller/TypoScriptFrontendControllerTest.php
typo3/sysext/frontend/Tests/Unit/Compatibility/LegacyDomainResolverTest.php [new file with mode: 0644]
typo3/sysext/frontend/Tests/Unit/Controller/TypoScriptFrontendControllerTest.php
typo3/sysext/frontend/Tests/UnitDeprecated/Controller/TypoScriptFrontendControllerTest.php [new file with mode: 0644]
typo3/sysext/install/Configuration/ExtensionScanner/Php/MethodCallMatcher.php
typo3/sysext/install/Configuration/ExtensionScanner/Php/MethodCallStaticMatcher.php