‪TYPO3CMS  ‪main
TYPO3\CMS\Frontend\Http\RequestHandler Class Reference
Inheritance diagram for TYPO3\CMS\Frontend\Http\RequestHandler:

Public Member Functions

 __construct (private readonly EventDispatcherInterface $eventDispatcher, private readonly ListenerProvider $listenerProvider, private readonly TimeTracker $timeTracker, private readonly FilePathSanitizer $filePathSanitizer, private readonly TypoScriptService $typoScriptService, private readonly Context $context,)
 
 handle (ServerRequestInterface $request)
 

Protected Member Functions

 resetGlobalsToCurrentRequest (ServerRequestInterface $request)
 
 generatePageContent (TypoScriptFrontendController $controller, ServerRequestInterface $request)
 
 generatePageBodyContent (TypoScriptFrontendController $controller, ServerRequestInterface $request)
 
 processHtmlBasedRenderingSettings (TypoScriptFrontendController $controller, ServerRequestInterface $request)
 
 stripIntObjectPlaceholder (&$searchString, &$intObjects)
 
 generateMetaTagHtml (array $metaTagTypoScript, ContentObjectRenderer $cObj)
 
 getPageRenderer ()
 
 addCssToPageRenderer (ServerRequestInterface $request, string $cssStyles, bool $excludeFromConcatenation, string $inlineBlockName)
 
string generateHtmlTag (array $htmlTagAttributes, array $configuration, ContentObjectRenderer $cObj)
 
 generateHrefLangTags (TypoScriptFrontendController $controller, ServerRequestInterface $request)
 
 displayPreviewInfoMessage (ServerRequestInterface $request, TypoScriptFrontendController $controller)
 
 getLanguageService ()
 

Detailed Description

This is the main entry point of the TypoScript driven standard front-end.

"handle()" is called when all PSR-15 middlewares have been set up the PSR-7 ServerRequest object and the following things have been evaluated

  • ‪correct page ID, page type (typeNum), rootline, MP etc.
  • ‪info if is cached content already available
  • ‪proper language
  • ‪proper TypoScript which should be processed.

Then, this class is able to render the actual HTTP body part built via TypoScript. Here this is split into two parts:

  • ‪Everything included in <body>, done via page.10, page.20 etc.
  • ‪Everything around.

If the content has been built together within the cache (cache_pages), it is fetched directly, and any so-called "uncached" content is generated again.

Some further events allow to post-process the content.

Then the right HTTP response headers are compiled together and sent as well.

Definition at line 70 of file RequestHandler.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Frontend\Http\RequestHandler::__construct ( private readonly EventDispatcherInterface  $eventDispatcher,
private readonly ListenerProvider  $listenerProvider,
private readonly TimeTracker  $timeTracker,
private readonly FilePathSanitizer  $filePathSanitizer,
private readonly TypoScriptService  $typoScriptService,
private readonly Context  $context 
)

Definition at line 72 of file RequestHandler.php.

Member Function Documentation

◆ addCssToPageRenderer()

TYPO3\CMS\Frontend\Http\RequestHandler::addCssToPageRenderer ( ServerRequestInterface  $request,
string  $cssStyles,
bool  $excludeFromConcatenation,
string  $inlineBlockName 
)
protected

Adds inline CSS code, by respecting the inlineStyle2TempFile option

Parameters
string$cssStyles‪the inline CSS styling
bool$excludeFromConcatenation‪option to see if it should be concatenated
string$inlineBlockName‪the block name to add it

Definition at line 822 of file RequestHandler.php.

References TYPO3\CMS\Frontend\Http\RequestHandler\getPageRenderer().

Referenced by TYPO3\CMS\Frontend\Http\RequestHandler\processHtmlBasedRenderingSettings().

◆ displayPreviewInfoMessage()

TYPO3\CMS\Frontend\Http\RequestHandler::displayPreviewInfoMessage ( ServerRequestInterface  $request,
TypoScriptFrontendController  $controller 
)
protected

Include the preview block in case we're looking at a hidden page in the LIVE workspace

this method might get moved to a PSR-15 middleware at some point

Definition at line 912 of file RequestHandler.php.

References TYPO3\CMS\Frontend\Http\RequestHandler\getLanguageService().

Referenced by TYPO3\CMS\Frontend\Http\RequestHandler\handle().

◆ generateHrefLangTags()

TYPO3\CMS\Frontend\Http\RequestHandler::generateHrefLangTags ( TypoScriptFrontendController  $controller,
ServerRequestInterface  $request 
)
protected

◆ generateHtmlTag()

string TYPO3\CMS\Frontend\Http\RequestHandler::generateHtmlTag ( array  $htmlTagAttributes,
array  $configuration,
ContentObjectRenderer  $cObj 
)
protected

Generates the <html> tag by evaluating TypoScript configuration, usually found via:

  • ‪Adding extra attributes in addition to pre-generated ones (e.g. "dir") config.htmlTag.attributes.no-js = 1 config.htmlTag.attributes.empty-attribute =
  • Adding one full string (no stdWrap!) to the "<html $htmlTagAttributes {config.htmlTag_setParams}>" tag config.htmlTag_setParams = string|"none"

    If config.htmlTag_setParams = none is set, even the pre-generated values are not added at all anymore.

  • ‪"config.htmlTag_stdWrap" always applies over the whole compiled tag.
Parameters
array$htmlTagAttributes‪pre-generated attributes by doctype/direction etc. values.
array$configuration‪the TypoScript configuration "config." array
ContentObjectRenderer$cObj
Returns
‪string the full <html> tag as string

Definition at line 861 of file RequestHandler.php.

References TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\stdWrap().

Referenced by TYPO3\CMS\Frontend\Http\RequestHandler\processHtmlBasedRenderingSettings().

◆ generateMetaTagHtml()

TYPO3\CMS\Frontend\Http\RequestHandler::generateMetaTagHtml ( array  $metaTagTypoScript,
ContentObjectRenderer  $cObj 
)
protected

Generate meta tags from meta tag TypoScript

Parameters
array$metaTagTypoScript‪TypoScript configuration for meta tags

Definition at line 771 of file RequestHandler.php.

References TYPO3\CMS\Frontend\Http\RequestHandler\getPageRenderer(), and TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\stdWrap().

Referenced by TYPO3\CMS\Frontend\Http\RequestHandler\processHtmlBasedRenderingSettings().

◆ generatePageBodyContent()

TYPO3\CMS\Frontend\Http\RequestHandler::generatePageBodyContent ( TypoScriptFrontendController  $controller,
ServerRequestInterface  $request 
)
protected

Generates the main content part within <body> tags (except JS files/CSS files), this means: render everything that can be cached, otherwise put placeholders for COA_INT/USER_INT objects in the content that is processed later-on.

Definition at line 224 of file RequestHandler.php.

Referenced by TYPO3\CMS\Frontend\Http\RequestHandler\generatePageContent().

◆ generatePageContent()

TYPO3\CMS\Frontend\Http\RequestHandler::generatePageContent ( TypoScriptFrontendController  $controller,
ServerRequestInterface  $request 
)
protected

Generates the main body part for the page, and if "config.disableAllHeaderCode" is not active, triggers pageRenderer to evaluate includeCSS, headTag etc. TypoScript processing to populate the pageRenderer.

Definition at line 192 of file RequestHandler.php.

References TYPO3\CMS\Frontend\Http\RequestHandler\generatePageBodyContent(), TYPO3\CMS\Frontend\Http\RequestHandler\getPageRenderer(), TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\isINTincScript(), and TYPO3\CMS\Frontend\Http\RequestHandler\processHtmlBasedRenderingSettings().

Referenced by TYPO3\CMS\Frontend\Http\RequestHandler\handle().

◆ getLanguageService()

TYPO3\CMS\Frontend\Http\RequestHandler::getLanguageService ( )
protected

◆ getPageRenderer()

◆ handle()

TYPO3\CMS\Frontend\Http\RequestHandler::handle ( ServerRequestInterface  $request)

◆ processHtmlBasedRenderingSettings()

TYPO3\CMS\Frontend\Http\RequestHandler::processHtmlBasedRenderingSettings ( TypoScriptFrontendController  $controller,
ServerRequestInterface  $request 
)
protected

At this point, the cacheable content has just been generated: Content is available but hasn't been added to PageRenderer yet. The method is called after the "main" page content, since some JS may be inserted at that point that has been registered by cacheable plugins. PageRenderer is now populated with all <head> data and additional JavaScript/CSS/FooterData/HeaderData that can be cached. Once finished, the content is added to the >addBodyContent() functionality.

Definition at line 244 of file RequestHandler.php.

References $GLOBALS, $headerComment, TYPO3\CMS\Frontend\Http\RequestHandler\addCssToPageRenderer(), TYPO3\CMS\Frontend\Http\RequestHandler\generateHrefLangTags(), TYPO3\CMS\Frontend\Http\RequestHandler\generateHtmlTag(), TYPO3\CMS\Frontend\Http\RequestHandler\generateMetaTagHtml(), TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\generatePageTitle(), TYPO3\CMS\Core\Utility\PathUtility\getAbsoluteWebPath(), TYPO3\CMS\Frontend\Http\RequestHandler\getPageRenderer(), TYPO3\CMS\Core\Core\Environment\getPublicPath(), TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\INTincScript_loadJSCode(), and TYPO3\CMS\Frontend\Http\RequestHandler\stripIntObjectPlaceholder().

Referenced by TYPO3\CMS\Frontend\Http\RequestHandler\generatePageContent().

◆ resetGlobalsToCurrentRequest()

TYPO3\CMS\Frontend\Http\RequestHandler::resetGlobalsToCurrentRequest ( ServerRequestInterface  $request)
protected

Sets the global GET and POST to the values, so if people access $_GET and $_POST Within hooks starting NOW (e.g. cObject), they get the "enriched" data from query params.

This needs to be run after the request object has been enriched with modified GET/POST variables.

Parameters
ServerRequestInterface$request

this safety net will be removed in TYPO3 v10.0.

Definition at line 90 of file RequestHandler.php.

References $GLOBALS.

Referenced by TYPO3\CMS\Frontend\Http\RequestHandler\handle().

◆ stripIntObjectPlaceholder()

TYPO3\CMS\Frontend\Http\RequestHandler::stripIntObjectPlaceholder ( $searchString,
$intObjects 
)
protected

Searches for placeholder created from *_INT cObjects, removes them from $searchString and merges them to $intObjects

Parameters
string$searchString‪The String which should be cleaned from int-object markers
string$intObjects‪The String the found int-placeholders are moved to (for further processing)

Definition at line 758 of file RequestHandler.php.

Referenced by TYPO3\CMS\Frontend\Http\RequestHandler\processHtmlBasedRenderingSettings().