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

Public Member Functions

 __construct (EventDispatcherInterface $eventDispatcher)
 
ResponseInterface handle (ServerRequestInterface $request)
 

Protected Member Functions

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

Protected Attributes

TimeTracker $timeTracker
 
EventDispatcherInterface $eventDispatcher
 

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 hooks allow to post-processing the content.

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

Definition at line 65 of file RequestHandler.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Frontend\Http\RequestHandler::__construct ( EventDispatcherInterface  $eventDispatcher)

Member Function Documentation

◆ addCssToPageRenderer()

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

Adds inline CSS code, by respecting the inlineStyle2TempFile option

Parameters
TypoScriptFrontendController$controller
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 990 of file RequestHandler.php.

References TYPO3\CMS\Core\Page\PageRenderer\addCssFile(), TYPO3\CMS\Core\Page\PageRenderer\addCssInlineBlock(), and TYPO3\CMS\Frontend\Http\RequestHandler\getPageRenderer().

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

◆ displayPreviewInfoMessage()

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

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

Parameters
TypoScriptFrontendController$controller

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

Definition at line 1077 of file RequestHandler.php.

References TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\doWorkspacePreview(), TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\getContext(), and 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 1027 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 (e.g. $GLOBALS['TSFE']->pSetup['meta.'])
ContentObjectRenderer$cObj

Definition at line 933 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()

string TYPO3\CMS\Frontend\Http\RequestHandler::generatePageBodyContent ( TypoScriptFrontendController  $controller)
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.

Parameters
TypoScriptFrontendController$controller
Returns
‪string

Definition at line 228 of file RequestHandler.php.

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

◆ generatePageContent()

string 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.

Parameters
TypoScriptFrontendController$controller
ServerRequestInterface$request
Returns
‪string

Definition at line 192 of file RequestHandler.php.

References TYPO3\CMS\Frontend\Http\RequestHandler\generatePageBodyContent(), TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\getLanguage(), 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()

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

Handles a frontend request, after finishing running middlewares

Parameters
ServerRequestInterface$request
Returns
‪ResponseInterface

Definition at line 113 of file RequestHandler.php.

References $GLOBALS, TYPO3\CMS\Frontend\Http\RequestHandler\displayPreviewInfoMessage(), TYPO3\CMS\Frontend\Http\RequestHandler\generatePageContent(), and TYPO3\CMS\Frontend\Http\RequestHandler\resetGlobalsToCurrentRequest().

◆ processHtmlBasedRenderingSettings()

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

At this point, the cacheable content has just been generated (thus, all 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.

Parameters
TypoScriptFrontendController$controller
SiteLanguage$siteLanguage
ServerRequestInterface$request

Definition at line 251 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\Core\Site\Entity\SiteLanguage\getDirection(), TYPO3\CMS\Core\Site\Entity\SiteLanguage\getHreflang(), TYPO3\CMS\Frontend\Http\RequestHandler\getPageRenderer(), TYPO3\CMS\Core\Core\Environment\getPublicPath(), if, TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\INTincScript_loadJSCode(), TYPO3\CMS\Core\Utility\GeneralUtility\minifyJavaScript(), 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 919 of file RequestHandler.php.

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

Member Data Documentation

◆ $eventDispatcher

EventDispatcherInterface TYPO3\CMS\Frontend\Http\RequestHandler::$eventDispatcher
protected

◆ $timeTracker

TimeTracker TYPO3\CMS\Frontend\Http\RequestHandler::$timeTracker
protected

Instance of the timetracker

Definition at line 70 of file RequestHandler.php.