‪TYPO3CMS  ‪main
TYPO3\CMS\Backend\Http\RouteDispatcher Class Reference
Inheritance diagram for TYPO3\CMS\Backend\Http\RouteDispatcher:
TYPO3\CMS\Core\Http\Dispatcher TYPO3\CMS\Core\Http\DispatcherInterface

Public Member Functions

 __construct (protected readonly FormProtectionFactory $formProtectionFactory, protected readonly AccessFactory $factory, protected readonly AccessStorage $storage, ContainerInterface $container,)
 
ResponseInterface dispatch (ServerRequestInterface $request)
 
- ‪Public Member Functions inherited from ‪TYPO3\CMS\Core\Http\Dispatcher
 __construct (ContainerInterface $container)
 

Protected Member Functions

 enforceReferrer (ServerRequestInterface $request, Route $route)
 
 assertRequestToken (ServerRequestInterface $request, Route $route)
 
 assertSudoMode (ServerRequestInterface $request)
 
- ‪Protected Member Functions inherited from ‪TYPO3\CMS\Core\Http\Dispatcher
callable getCallableFromTarget ($target)
 

Additional Inherited Members

- ‪Protected Attributes inherited from ‪TYPO3\CMS\Core\Http\Dispatcher
ContainerInterface $container
 

Detailed Description

Dispatcher which resolves a route to call a controller and method (but also a callable)

Definition at line 40 of file RouteDispatcher.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Backend\Http\RouteDispatcher::__construct ( protected readonly FormProtectionFactory  $formProtectionFactory,
protected readonly AccessFactory  $factory,
protected readonly AccessStorage  $storage,
ContainerInterface  $container 
)

Definition at line 42 of file RouteDispatcher.php.

References TYPO3\CMS\Core\Http\Dispatcher\$container.

Member Function Documentation

◆ assertRequestToken()

TYPO3\CMS\Backend\Http\RouteDispatcher::assertRequestToken ( ServerRequestInterface  $request,
Route  $route 
)
protected

Checks if the request token is valid. This is checked to see if the route is really created by the same instance. Should be called for all routes in the backend except for the ones that don't require a login.

See also
‪UriBuilder where the token is generated.

Definition at line 109 of file RouteDispatcher.php.

References TYPO3\CMS\Backend\Routing\Route\getOption(), and TYPO3\CMS\Backend\Routing\Route\getPath().

Referenced by TYPO3\CMS\Backend\Http\RouteDispatcher\dispatch().

◆ assertSudoMode()

TYPO3\CMS\Backend\Http\RouteDispatcher::assertSudoMode ( ServerRequestInterface  $request)
protected

Asserts that sudo mode verification was processed for this route before and that it did not expire, yet. In case (re-)verification is required, a corresponding AccessClaim is persisted in the user session storage, and the process of showing the verification dialogs is initiated.

Definition at line 136 of file RouteDispatcher.php.

References TYPO3\CMS\Core\Core\Environment\getContext().

Referenced by TYPO3\CMS\Backend\Http\RouteDispatcher\dispatch().

◆ dispatch()

ResponseInterface TYPO3\CMS\Backend\Http\RouteDispatcher::dispatch ( ServerRequestInterface  $request)

Main method checks the target of the route, and tries to call it.

Parameters
ServerRequestInterface$request‪the current server request
Returns
‪ResponseInterface the filled response by the callable / controller/action
Exceptions
InvalidRequestTokenException‪if the route requested a token, but this token did not match
MissingRequestTokenException‪if the route requested a token, but there was none

Reimplemented from TYPO3\CMS\Core\Http\Dispatcher.

Definition at line 60 of file RouteDispatcher.php.

References TYPO3\CMS\Backend\Http\RouteDispatcher\assertRequestToken(), TYPO3\CMS\Backend\Http\RouteDispatcher\assertSudoMode(), TYPO3\CMS\Backend\Http\RouteDispatcher\enforceReferrer(), and TYPO3\CMS\Core\Http\Dispatcher\getCallableFromTarget().

◆ enforceReferrer()

TYPO3\CMS\Backend\Http\RouteDispatcher::enforceReferrer ( ServerRequestInterface  $request,
Route  $route 
)
protected

Evaluates HTTP Referer header (which is denied by client to be a custom value) - attempts to ensure the value is given using a HTML client refresh. see: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referer

Definition at line 85 of file RouteDispatcher.php.

References TYPO3\CMS\Backend\Routing\Route\getOption(), TYPO3\CMS\Backend\Routing\Route\getPath(), and TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode().

Referenced by TYPO3\CMS\Backend\Http\RouteDispatcher\dispatch().