‪TYPO3CMS  9.5
TYPO3\CMS\Frontend\Http\RequestHandler Class Reference
Inheritance diagram for TYPO3\CMS\Frontend\Http\RequestHandler:
TYPO3\CMS\Core\Http\RequestHandlerInterface

Public Member Functions

ResponseInterface handleRequest (ServerRequestInterface $request)
 
ResponseInterface null handle (ServerRequestInterface $request)
 
bool canHandleRequest (ServerRequestInterface $request)
 
int getPriority ()
 

Protected Member Functions

ServerRequestInterface addModifiedGlobalsToIncomingRequest (ServerRequestInterface $request)
 
 resetGlobalsToCurrentRequest (ServerRequestInterface $request)
 
string generatePageContent (TypoScriptFrontendController $controller)
 
string generatePageContentWithHeader (TypoScriptFrontendController $controller, ?SiteLanguage $siteLanguage)
 
 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)
 

Protected Attributes

TimeTracker $timeTracker
 

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 59 of file RequestHandler.php.

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 1085 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\generatePageContentWithHeader().

◆ addModifiedGlobalsToIncomingRequest()

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

Puts parameters that have been added or removed from the global _GET or _POST arrays into the given request (however, the PSR-7 request information takes precedence).

Parameters
ServerRequestInterface$request
Returns
‪ServerRequestInterface

Definition at line 84 of file RequestHandler.php.

References $GLOBALS, and TYPO3\CMS\Core\Utility\ArrayUtility\arrayDiffAssocRecursive().

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

◆ canHandleRequest()

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

This request handler can handle any frontend request.

Parameters
ServerRequestInterface$request
Returns
‪bool If the request is not an eID request, TRUE otherwise FALSE

Implements TYPO3\CMS\Core\Http\RequestHandlerInterface.

Definition at line 1154 of file RequestHandler.php.

◆ generateHtmlTag()

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

Generates the <html> tag by evaluting 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 1122 of file RequestHandler.php.

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

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

◆ 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 1028 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\generatePageContentWithHeader().

◆ generatePageContent()

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

Generates the main content part within <body> tags (except JS files/CSS files).

Parameters
TypoScriptFrontendController$controller
Returns
‪string

Definition at line 243 of file RequestHandler.php.

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

◆ generatePageContentWithHeader()

string TYPO3\CMS\Frontend\Http\RequestHandler::generatePageContentWithHeader ( TypoScriptFrontendController  $controller,
?SiteLanguage  $siteLanguage 
)
protected

◆ getPageRenderer()

◆ getPriority()

int TYPO3\CMS\Frontend\Http\RequestHandler::getPriority ( )

Returns the priority - how eager the handler is to actually handle the request.

Returns
‪int The priority of the request handler.

Implements TYPO3\CMS\Core\Http\RequestHandlerInterface.

Definition at line 1165 of file RequestHandler.php.

◆ handle()

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

◆ handleRequest()

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

Handles a frontend request

Parameters
ServerRequestInterface$request
Returns
‪ResponseInterface

Implements TYPO3\CMS\Core\Http\RequestHandlerInterface.

Definition at line 72 of file RequestHandler.php.

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

◆ 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 121 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 1014 of file RequestHandler.php.

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

Member Data Documentation

◆ $timeTracker

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

Instance of the timetracker

Definition at line 64 of file RequestHandler.php.