[TASK] Add API to hide PseudoSite functionality 92/57992/6
authorBenni Mack <benni@typo3.org>
Wed, 22 Aug 2018 17:18:57 +0000 (19:18 +0200)
committerAndreas Fernandez <a.fernandez@scripting-base.de>
Wed, 22 Aug 2018 19:59:46 +0000 (21:59 +0200)
commitcf1d0f1742aad3b21ec7a2dde1a5e615d9a38d80
tree0e7e8a48379e80129519fec9a3d10e7c03d2602e
parent6665ed6101e5123c9cf62d0c71c8ecaec433221b
[TASK] Add API to hide PseudoSite functionality

In order to avoid usages of using PseudoSite objects directly,
the following changes have been made:

The main entrypoint for finding sites is now encapsulated the
SiteMatcher class.

* SiteMatcher->matchByPageId($pageId)
which consistently checks for Sites and Pseudo Sites. This is now
a singleton as it factors PseudoSiteFinder directly.

* NullSite for PID=0 (which is a slim version of a PseudoSite
and will stay around for longer than the PseudoSite).

This marks the last part of the Site API functionality, as
TYPO3 is now ready to work with the Site API in all places
throughout Frontend and Backend.

Resolves: #85930
Releases: master
Change-Id: I5e75da22337e126a39b459388e21d7f9fe05e556
Reviewed-on: https://review.typo3.org/57992
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Tested-by: Andreas Fernandez <a.fernandez@scripting-base.de>
12 files changed:
typo3/sysext/backend/Classes/Controller/EditDocumentController.php
typo3/sysext/backend/Classes/Form/FormDataProvider/SiteResolving.php
typo3/sysext/backend/Classes/Middleware/SiteResolver.php
typo3/sysext/backend/Classes/View/PageLayoutView.php
typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/SiteResolvingTest.php
typo3/sysext/core/Classes/Routing/SiteMatcher.php
typo3/sysext/core/Classes/Site/Entity/NullSite.php [new file with mode: 0644]
typo3/sysext/core/Classes/Site/Entity/PseudoSite.php
typo3/sysext/core/Classes/Site/Entity/SiteInterface.php
typo3/sysext/core/Classes/Site/PseudoSiteFinder.php
typo3/sysext/core/Classes/Site/SiteFinder.php
typo3/sysext/frontend/Tests/Unit/Middleware/SiteResolverTest.php