[TASK] Clean up Routing API 49/58149/9
authorOliver Hader <oliver@typo3.org>
Tue, 25 Sep 2018 07:51:52 +0000 (09:51 +0200)
committerOliver Hader <oliver.hader@typo3.org>
Wed, 26 Sep 2018 16:20:07 +0000 (18:20 +0200)
commit8f73f70369f053da2b5ce0e4b49d5b631e508249
treea2d1c0b1477c789966ac83974b873c3158592b7a
parenta8a1a78fffb1fff1cda8a570e14cb0f6870ee0b0
[TASK] Clean up Routing API

The PageUriBuilder is gone, as all is centralized in the
PageRouter now, which acts as the centralized place to resolve
Requests ("matchRequest") and to create URLs ("generateUri")
for pages that have a site configuration.

RouterInterface is the abstract interface which is intended to be
used within Backend as well in the future, and provides a good basis
for both cases (that's why page ID and SiteInterface is not hardcoded
in the API).

RouteResultInterface is introduced to allow further Result objects
like page-specific results, useful for future routing improvements.

Since PageUriBuilder was only used in cases where there was a
site, the Router is now bound to a site (see constructor).

When generating a URL, the PageRouter can receive a special
argument called "_language" to hand over a SiteLanguage object.

Resolves: #86388
Releases: master
Change-Id: Ib090d3373a88cb7c534557ef21b46dce646078b5
Reviewed-on: https://review.typo3.org/58149
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Oliver Hader <oliver.hader@typo3.org>
Tested-by: Oliver Hader <oliver.hader@typo3.org>
20 files changed:
typo3/sysext/backend/Classes/Utility/BackendUtility.php
typo3/sysext/core/Classes/Error/PageErrorHandler/PageContentErrorHandler.php
typo3/sysext/core/Classes/Routing/PageRouter.php
typo3/sysext/core/Classes/Routing/PageUriBuilder.php [deleted file]
typo3/sysext/core/Classes/Routing/RouteResult.php
typo3/sysext/core/Classes/Routing/RouteResultInterface.php [new file with mode: 0644]
typo3/sysext/core/Classes/Routing/RouterInterface.php [new file with mode: 0644]
typo3/sysext/core/Classes/Routing/SiteMatcher.php
typo3/sysext/core/Classes/Site/Entity/Site.php
typo3/sysext/core/Migrations/Code/ClassAliasMap.php
typo3/sysext/core/Tests/Unit/Routing/PageRouterTest.php
typo3/sysext/frontend/Classes/Middleware/PageResolver.php
typo3/sysext/frontend/Classes/Middleware/StaticRouteResolver.php
typo3/sysext/frontend/Classes/Typolink/PageLinkBuilder.php
typo3/sysext/frontend/Tests/Unit/Middleware/PageResolverTest.php
typo3/sysext/seo/Tests/Functional/Canonical/CanonicalGeneratorTest.php
typo3/sysext/seo/Tests/Functional/Fixtures/pages-canonical.xml
typo3/sysext/seo/Tests/Functional/Fixtures/pages-sitemap.xml
typo3/sysext/seo/Tests/Functional/XmlSitemap/XmlSitemapIndexTest.php
typo3/sysext/viewpage/Classes/Controller/ViewModuleController.php