‪TYPO3CMS  ‪main
TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController Class Reference
Inheritance diagram for TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController:

Public Member Functions

array< string, $config=array();protected int $cacheTimeOutDefault=0;protected bool $pageContentWasLoadedFromCache=false;protected int $cacheExpires=0;public string $newHash='';public array $additionalHeaderData=array();public array $additionalFooterData=array();public string $absRefPrefix='';public string $linkVars='';public array $applicationData=[];public array $register=[];public array $registerStack=[];public array $recordRegister=[];public string $currentRecord='';protected int $uniqueCounter=0;protected string $uniqueString='';public ContentObjectRenderer $cObj;public string $content='';public ?array $lastImgResourceInfo=null;protected ?LanguageService $languageService=null;public ?ResourceMutex $lock=null;protected ?PageRenderer $pageRenderer=null;protected FrontendInterface $pageCache;protected array $pageCacheTags=[];protected string $contentType='text/html;charset=utf-8';protected int $requestedId=0;protected Context $context;protected string $debugInformationHeader='';public __construct(Context $context, Site $site, SiteLanguage $siteLanguage, PageArguments $pageArguments, FrontendUserAuthentication $frontendUser) { $this-> initializeContext ($context)
 setContentType ($contentType)
 determineId (ServerRequestInterface $request)
array getPageAccessFailureReasons (string $failureReasonCode=null)
ServerRequestInterface getFromCache (ServerRequestInterface $request)
 calculateLinkVars (array $queryParams)
 getRedirectUriForMountPoint (ServerRequestInterface $request)
 getRedirectUriForShortcut (ServerRequestInterface $request)
 isGeneratePage ()
 addCacheTags (array $tags)
 getPageCacheTags ()
 preparePageContentGeneration (ServerRequestInterface $request)
 generatePage_postProcessing (ServerRequestInterface $request)
string generatePageTitle ()
 INTincScript (ServerRequestInterface $request)
 INTincScript_loadJSCode ()
bool isINTincScript ()
 applyHttpHeadersToResponse (ResponseInterface $response)
bool isStaticCacheble ()
 newCObj (ServerRequestInterface $request=null)
 logDeprecatedTyposcript ($typoScriptProperty, $explanation='')
string uniqueHash ($str='')
 set_no_cache ($reason='', $internalRequest=false)
 set_cache_timeout_default ($seconds)
 get_cache_timeout ()
string sL ($input)
 getRequestedId ()
 releaseLocks ()
 getLanguage ()
 getSite ()
 getContext ()
 getPageArguments ()

Public Attributes

int $id
bool $no_cache = false
array $rootLine = []
array $page = array( )
int $contentPid = 0
PageRepository string $sys_page = ''
string $MP = ''
FrontendUserAuthentication $fe_user
$this site = $site
$this language = $siteLanguage
$this fe_user = $frontendUser
$this uniqueString = md5(microtime())

Protected Member Functions

 initPageRenderer ()
 initCaches ()
 evaluatePageNotFound (int $pageNotFoundNumber, ServerRequestInterface $request)
 getPageAndRootline (ServerRequestInterface $request)
 checkRootlineForIncludeSection ()
 setPageArguments (PageArguments $pageArguments)
 getRelevantParametersForCachingFromPageArguments (PageArguments $pageArguments)
 populatePageDataFromCache (array $cachedData)
bool shouldAcquireCacheData (ServerRequestInterface $request)
string createHashBase (array $sysTemplateRows, array $constantConditionList, array $setupConditionList)
 settingLanguage (ServerRequestInterface $request)
 updateRootLinesWithTranslations ()
 getUriToCurrentPageForRedirect (ServerRequestInterface $request)
 setPageCacheContent (string $content, array $data, int $expirationTstamp)
 setSysLastChanged ()
 setRegisterValueForSysLastChanged (array $page)
int resolveContentPid (ServerRequestInterface $request)
string printTitle (string $pageTitle, bool $noPageTitle=false, bool $showPageTitleFirst=false, string $pageTitleSeparator='', bool $showWebsiteTitle=true)
 getWebsiteTitle ()
 recursivelyReplaceIntPlaceholdersInContent (ServerRequestInterface $request)
 processNonCacheableContentPartsAndSubstituteContentMarkers (array $nonCacheableData, ServerRequestInterface $request)
 getCacheHeaders ()
 setAbsRefPrefix ()
 disableCache ()
 getAdditionalHeaders ()
 logPageAccessFailure (string $message, ServerRequestInterface $request)
FrontendBackendUserAuthentication null getBackendUser ()
TimeTracker getTimeTracker ()

Protected Attributes

Site $site
SiteLanguage $language
PageArguments $pageArguments
array $originalMountPointPage = null
array $originalShortcutPage = null
int $pageNotFound = 0
array $pageAccessFailureHistory = []

Private Member Functions

 initializeContext (Context $context)

Detailed Description

Main controller class of the TypoScript based frontend.

This is prepared in Frontend middlewares and the content rendering is ultimately called in \TYPO3\CMS\Frontend\Http\RequestHandler.

When calling a Frontend page, an instance of this object is available as $GLOBALS['TSFE'], even though the core development strives to get rid of this in the future.

Definition at line 102 of file TypoScriptFrontendController.php.

Member Function Documentation

◆ addCacheTags()

TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::addCacheTags ( array  $tags)

Adds tags to this page's cache entry, you can then f.e. remove cache entries by tag

array$tags‪An array of tag

Definition at line 1781 of file TypoScriptFrontendController.php.

Referenced by TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\render(), TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\stdWrap_addPageCacheTags(), and TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\stdWrap_cacheStore().

◆ applyHttpHeadersToResponse()

TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::applyHttpHeadersToResponse ( ResponseInterface  $response)

◆ calculateLinkVars()

TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::calculateLinkVars ( array  $queryParams)

Calculates and sets the internal linkVars based upon the current request parameters and the setting "config.linkVars".

array$queryParams‪$_GET (usually called with a PSR-7 $request->getQueryParams())

Definition at line 1598 of file TypoScriptFrontendController.php.

Referenced by TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\getUriToCurrentPageForRedirect(), and TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\preparePageContentGeneration().

◆ checkRootlineForIncludeSection()

TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::checkRootlineForIncludeSection ( )

Checks if visibility of the page is blocked upwards in the root line.

If any page in the root line is blocking visibility, true is returned.

All pages from the blocking page downwards are removed from the root line, so that the remaining pages can be used to relocate the page up to lowest visible page.

The blocking feature of a page must be turned on by setting the page record field 'extendToSubpages' to 1 in case of hidden, starttime, endtime or fe_group restrictions.

Additionally, this method checks for backend user sections in root line and if found, evaluates if a backend user is logged in and has access.

Recyclers are also checked and trigger page not found if found in root line.


Find a better name, i.e. checkVisibilityByRootLine

Invert boolean return value. Return true if visible.

Definition at line 859 of file TypoScriptFrontendController.php.

References TYPO3\CMS\Core\Domain\Repository\PageRepository\DOKTYPE_BE_USER_SECTION, TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\getBackendUser(), and TYPO3\CMS\Core\Type\Bitmask\Permission\PAGE_SHOW.

Referenced by TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\getPageAndRootline().

◆ createHashBase()

string TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::createHashBase ( array  $sysTemplateRows,
array  $constantConditionList,
array  $setupConditionList 

This creates a hash used as page cache entry identifier and as page generation lock. When multiple requests try to render the same page that will result in the same page cache entry, this lock allows creation by one request which typically puts the result into page cache, while the other requests wait until this finished and re-use the result.

This hash is unique to the TS template and constant and setup condition verdict, the variables ->id, ->type, list of frontend user groups, ->MP (Mount Points) and cHash array.

‪string Page cache entry identifier also used as page generation lock

Definition at line 1438 of file TypoScriptFrontendController.php.

References $GLOBALS, TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$id, TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\getRelevantParametersForCachingFromPageArguments(), TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\language, and TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\site.

Referenced by TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\getFromCache().

◆ determineId()

TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::determineId ( ServerRequestInterface  $request)

Resolves the page id and sets up several related properties.

At this point, the Context object already contains relevant preview settings (if a backend user is logged in etc).

If $this->id is not set at all, the method does its best to set the value to an integer. Resolving is based on this options:

  • ‪Finding the domain record start page
  • ‪First visible page
  • ‪Relocating the id below the site if outside the site / domain

The following properties may be set up or updated:

  • ‪id
  • ‪sys_page
  • ‪sys_page->where_groupAccess
  • ‪sys_page->where_hid_del
  • ‪register['SYS_LASTCHANGED']
  • ‪pageNotFound

Via getPageAndRootline()

  • ‪rootLine
  • ‪page
  • ‪MP
  • ‪originalShortcutPage
  • ‪originalMountPointPage
  • ‪pageAccessFailureHistory['direct_access']
  • ‪pageNotFound

Definition at line 506 of file TypoScriptFrontendController.php.

References TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\evaluatePageNotFound(), TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\getPageAndRootline(), TYPO3\CMS\Core\Http\ImmediateResponseException\getResponse(), TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\getTimeTracker(), TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\resolveContentPid(), TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\setRegisterValueForSysLastChanged(), TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\settingLanguage(), and TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\site.

◆ disableCache()

TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::disableCache ( )

Disables caching of the current page.

Definition at line 2335 of file TypoScriptFrontendController.php.

Referenced by TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\set_no_cache().

◆ evaluatePageNotFound()

TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::evaluatePageNotFound ( int  $pageNotFoundNumber,
ServerRequestInterface  $request 

◆ generatePage_postProcessing()

TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::generatePage_postProcessing ( ServerRequestInterface  $request)

◆ generatePageTitle()

string TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::generatePageTitle ( )

Generate the page title, can be called multiple times, as PageTitleProvider might have been modified by an uncached plugin etc.

‪string the generated page title

Definition at line 1878 of file TypoScriptFrontendController.php.

References TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\printTitle().

Referenced by TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\INTincScript(), and TYPO3\CMS\Frontend\Http\RequestHandler\processHtmlBasedRenderingSettings().

◆ get_cache_timeout()

TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::get_cache_timeout ( )

Get the cache timeout for the current page.

Definition at line 2356 of file TypoScriptFrontendController.php.

Referenced by TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\generatePage_postProcessing().

◆ getAdditionalHeaders()

TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::getAdditionalHeaders ( )

Send additional headers from config.additionalHeaders

Definition at line 2410 of file TypoScriptFrontendController.php.

Referenced by TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\applyHttpHeadersToResponse().

◆ getBackendUser()

FrontendBackendUserAuthentication null TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::getBackendUser ( )

Returns the current BE user.

‪: Add PHP return type declaration and ensure, that classes using TSFE in BE/CLI context always instantiate a FrontendBackendUserAuthentication object in $GLOBALS['BE_USER'].

Definition at line 2454 of file TypoScriptFrontendController.php.

References $GLOBALS.

Referenced by TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\checkRootlineForIncludeSection().

◆ getCacheHeaders()

◆ getContext()

◆ getFromCache()

ServerRequestInterface TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::getFromCache ( ServerRequestInterface  $request)

This is a central and quite early method called by PrepareTypoScriptFrontendRendering middleware: This code is always executed for every frontend call if a general page rendering has to be done, if there is no early redirect or eid call or similar.

The goal is to calculate dependencies up to a point to see if a possible page cache can be used, and to prepare TypoScript as far as really needed.

‪ServerRequestInterface New request object with typoscript attribute

This method may vanish from TypoScriptFrontendController without further notice.

‪: This method is typically called by PrepareTypoScriptFrontendRendering middleware. However, the RedirectService of (earlier) ext:redirects RedirectHandler middleware calls this as well. We may want to put this code into some helper class, reduce class state as much as possible and carry really needed state as request attributes around?!

Definition at line 986 of file TypoScriptFrontendController.php.

References $GLOBALS, TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$id, TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$page, TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$rootLine, TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$site, TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\createHashBase(), TYPO3\CMS\Core\Site\Entity\Site\getAttribute(), TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\getSite(), TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\getTimeTracker(), TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\isINTincScript(), TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\populatePageDataFromCache(), TYPO3\CMS\Core\TimeTracker\TimeTracker\pull(), TYPO3\CMS\Core\TimeTracker\TimeTracker\push(), TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\releaseLocks(), TYPO3\CMS\Frontend\Page\PageAccessFailureReasons\RENDERING_INSTRUCTIONS_NOT_CONFIGURED, TYPO3\CMS\Frontend\Page\PageAccessFailureReasons\RENDERING_INSTRUCTIONS_NOT_FOUND, TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\set_no_cache(), and TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\shouldAcquireCacheData().

◆ getLanguage()

◆ getPageAccessFailureReasons()

array TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::getPageAccessFailureReasons ( string  $failureReasonCode = null)

Analysing $this->pageAccessFailureHistory into a summary array telling which features disabled display and on which pages and conditions. That data can be used inside a page-not-found handler

string | null$failureReasonCode‪the error code to be attached (optional), see PageAccessFailureReasons list for details
‪array Summary of why page access was not allowed.

Definition at line 900 of file TypoScriptFrontendController.php.

References $GLOBALS, and $output.

Referenced by TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\evaluatePageNotFound(), TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\getPageAndRootline(), and TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\getRedirectUriForShortcut().

◆ getPageAndRootline()

TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::getPageAndRootline ( ServerRequestInterface  $request)

Loads the page and root line records based on $this->id

A final page and the matching root line are determined and loaded by the algorithm defined by this method.

First it loads the initial page from the page repository for $this->id. If that can't be loaded directly, it gets the root line for $this->id. It walks up the root line towards the root page until the page repository can deliver a page record. (The loading restrictions of the root line records are more liberal than that of the page record.)

Now the page type is evaluated and handled if necessary. If the page is a short cut, it is replaced by the target page. If the page is a mount point in overlay mode, the page is replaced by the mounted page.

After this potential replacements are done, the root line is loaded (again) for this page record. It walks up the root line up to the first viewable record.

(While upon the first accessibility check of the root line it was done by loading page by page from the page repository, this time the method checkRootlineForIncludeSection() is used to find the most distant accessible page within the root line.)

Having found the final page id, the page record and the root line are loaded for last time by this method.

Exceptions may be thrown for DOKTYPE_SPACER and not loadable page records or root lines.

May set or update these properties:

See also

Definition at line 650 of file TypoScriptFrontendController.php.

References $GLOBALS, TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$page, TYPO3\CMS\Frontend\Page\PageAccessFailureReasons\ACCESS_DENIED_INVALID_PAGETYPE, TYPO3\CMS\Frontend\Page\PageAccessFailureReasons\ACCESS_DENIED_SUBSECTION_NOT_RESOLVED, TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\checkRootlineForIncludeSection(), TYPO3\CMS\Core\Domain\Repository\PageRepository\DOKTYPE_MOUNTPOINT, TYPO3\CMS\Core\Domain\Repository\PageRepository\DOKTYPE_SHORTCUT, TYPO3\CMS\Core\Domain\Repository\PageRepository\DOKTYPE_SPACER, TYPO3\CMS\Core\Domain\Repository\PageRepository\DOKTYPE_SYSFOLDER, TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\getPageAccessFailureReasons(), TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\logPageAccessFailure(), TYPO3\CMS\Frontend\Page\PageAccessFailureReasons\PAGE_NOT_FOUND, TYPO3\CMS\Frontend\Page\PageAccessFailureReasons\ROOTLINE_BROKEN, and TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\settingLanguage().

Referenced by TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\determineId().

◆ getPageArguments()

◆ getPageCacheTags()

TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::getPageCacheTags ( )

Definition at line 1786 of file TypoScriptFrontendController.php.

◆ getRedirectUriForMountPoint()

TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::getRedirectUriForMountPoint ( ServerRequestInterface  $request)

Returns URI of target page, if the current page is an overlaid mountpoint.

If the current page is of type mountpoint and should be overlaid with the contents of the mountpoint page and is accessed directly, the user will be redirected to the mountpoint context.


Definition at line 1616 of file TypoScriptFrontendController.php.

References TYPO3\CMS\Core\Domain\Repository\PageRepository\DOKTYPE_MOUNTPOINT, and TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\getUriToCurrentPageForRedirect().

◆ getRedirectUriForShortcut()

TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::getRedirectUriForShortcut ( ServerRequestInterface  $request)

◆ getRelevantParametersForCachingFromPageArguments()

TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::getRelevantParametersForCachingFromPageArguments ( PageArguments  $pageArguments)

Fetches the arguments that are relevant for creating the hash base from the given PageArguments object. Excluded parameters are not taken into account when calculating the hash base.

Definition at line 957 of file TypoScriptFrontendController.php.

References TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$pageArguments, TYPO3\CMS\Core\Utility\HttpUtility\buildQueryString(), and TYPO3\CMS\Core\Routing\PageArguments\getPageId().

Referenced by TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\createHashBase().

◆ getRequestedId()

TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::getRequestedId ( )

Returns the originally requested page uid when TSFE was instantiated initially.

Definition at line 2390 of file TypoScriptFrontendController.php.

◆ getSite()

◆ getTimeTracker()

◆ getUriToCurrentPageForRedirect()

TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::getUriToCurrentPageForRedirect ( ServerRequestInterface  $request)

◆ getWebsiteTitle()

◆ initCaches()

TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::initCaches ( )

Initializes the caching system.

Definition at line 468 of file TypoScriptFrontendController.php.

◆ initializeContext() [1/2]

array<string, $config = array( ); protected int $cacheTimeOutDefault = 0; protected bool $pageContentWasLoadedFromCache = false; protected int $cacheExpires = 0; public string $newHash = ''; public array $additionalHeaderData = array( ); public array $additionalFooterData = array( ); public string $absRefPrefix = ''; public string $linkVars = ''; public array $applicationData = []; public array $register = []; public array $registerStack = []; public array $recordRegister = []; public string $currentRecord = ''; protected int $uniqueCounter = 0; protected string $uniqueString = ''; public ContentObjectRenderer $cObj; public string $content = ''; public ?array $lastImgResourceInfo = null; protected ?LanguageService $languageService = null; public ?ResourceMutex $lock = null; protected ?PageRenderer $pageRenderer = null; protected FrontendInterface $pageCache; protected array $pageCacheTags = []; protected string $contentType = 'text/html; charset=utf-8'; protected int $requestedId = 0; protected Context $context; protected string $debugInformationHeader = ''; public __construct(Context $context, Site $site, SiteLanguage $siteLanguage, PageArguments $pageArguments, FrontendUserAuthentication $frontendUser) { $this-> TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::initializeContext (   $context)

A central data array consisting of various keys, initialized and processed at various places in the class.

This array is cached along with the rendered page content and contains for instance a list of INT identifiers used to calculate 'dynamic' page parts when a page is retrieved from cache.

Some sub keys:

'config': This is the TypoScript ['config.'] sub-array, with some settings being sanitized and merged.

'rootLine': This is the "local" rootline of a deep page that stops at the first parent sys_template record that has "root" flag set, in natural parent-child order.

Both language and version overlays are applied to these page records: All "data" fields are set to language / version overlay values, except uid and pid, which are the default-language and live-version ids.

When page uid 5 is called in this example: [0] Project name |- [2] An organizational page, probably with is_siteroot=1 and a site config |- [3] Site root with a sys_template having "root" flag set |- [5] Here you are

This rootLine is: [0] => [uid = 3, pid = 2, title = Site root with a sys_template having "root" flag set, ...] [1] => [uid = 5, pid = 3, title = Here you are, ...]


◆ initializeContext() [2/2]

TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::initializeContext ( Context  $context)

◆ initPageRenderer()

TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::initPageRenderer ( )

◆ INTincScript()

◆ INTincScript_loadJSCode()

TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::INTincScript_loadJSCode ( )

Loads the JavaScript/CSS code for INTincScript, if there are non-cacheable content objects it prepares the placeholders, otherwise populates options directly.

this method should be renamed as it does not only handle JS, but all additional header data

Definition at line 2077 of file TypoScriptFrontendController.php.

References TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\isINTincScript(), and TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\uniqueHash().

Referenced by TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\INTincScript(), and TYPO3\CMS\Frontend\Http\RequestHandler\processHtmlBasedRenderingSettings().

◆ isGeneratePage()

TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::isGeneratePage ( )

Returns TRUE if the page content should be generated.

Definition at line 1687 of file TypoScriptFrontendController.php.

◆ isINTincScript()

◆ isStaticCacheble()

bool TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::isStaticCacheble ( )

Reporting status whether we can send cache control headers for proxy caching or publishing to static files

Rules are: no_cache cannot be set: If it is, the page might contain dynamic content and should never be cached. There can be no USER_INT objects on the page ("isINTincScript()") because they implicitly indicate dynamic content There can be no logged in user because user sessions are based on a cookie and thereby does not offer client caching a chance to know if the user is logged in. Actually, there will be a reverse problem here; If a page will somehow change when a user is logged in he may not see it correctly if the non-login version sent a cache-header! So do NOT use cache headers in page sections where user logins change the page content. (unless using such as realurl to apply a prefix in case of login sections)


Definition at line 2202 of file TypoScriptFrontendController.php.

References TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\isINTincScript().

Referenced by TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\getCacheHeaders().

◆ logDeprecatedTyposcript()

TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::logDeprecatedTyposcript (   $typoScriptProperty,
  $explanation = '' 

Logs access to deprecated TypoScript objects and properties.

Dumps message to the TypoScript message log (admin panel) and the TYPO3 deprecation log.

string$typoScriptProperty‪Deprecated object or property
string$explanation‪Message or additional information

Definition at line 2271 of file TypoScriptFrontendController.php.

References TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\getTimeTracker(), and TYPO3\CMS\Core\TimeTracker\TimeTracker\setTSlogMessage().

◆ logPageAccessFailure()

TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::logPageAccessFailure ( string  $message,
ServerRequestInterface  $request 

Log the page access failure with additional request information

Definition at line 2438 of file TypoScriptFrontendController.php.

References TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$id.

Referenced by TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\getPageAndRootline().

◆ newCObj()

TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::newCObj ( ServerRequestInterface  $request = null)

Creates an instance of ContentObjectRenderer in $this->cObj This instance is used to start the rendering of the TypoScript template structure

ServerRequestInterface | null$request

Definition at line 2218 of file TypoScriptFrontendController.php.

Referenced by TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\preparePageContentGeneration().

◆ populatePageDataFromCache()

TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::populatePageDataFromCache ( array  $cachedData)

This method properly sets the values given from the pages cache into the corresponding TSFE variables. The counterpart is setPageCacheContent() where all relevant information is fetched. This also contains all data that could be cached, even for pages that are partially cached, as they have non-cacheable content still to be rendered.

See also

Definition at line 1379 of file TypoScriptFrontendController.php.

References $GLOBALS.

Referenced by TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\getFromCache().

◆ preparePageContentGeneration()

TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::preparePageContentGeneration ( ServerRequestInterface  $request)

◆ printTitle()

string TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::printTitle ( string  $pageTitle,
bool  $noPageTitle = false,
bool  $showPageTitleFirst = false,
string  $pageTitleSeparator = '',
bool  $showWebsiteTitle = true 

Compiles the content for the page <title> tag.

string$pageTitle‪The input title string, typically the "title" field of a page's record.
bool$noPageTitle‪If set, the page title will not be printed
bool$showPageTitleFirst‪If set, website title and page title are swapped
string$pageTitleSeparator‪an alternative to the ": " as the separator between site title and page title
bool$showWebsiteTitle‪If set, the website title will be printed
‪string The page title on the form "[website title]: [input-title]". Not htmlspecialchar()'ed.
See also

Definition at line 1926 of file TypoScriptFrontendController.php.

References TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\getWebsiteTitle().

Referenced by TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\generatePageTitle().

◆ processNonCacheableContentPartsAndSubstituteContentMarkers()

TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::processNonCacheableContentPartsAndSubstituteContentMarkers ( array  $nonCacheableData,
ServerRequestInterface  $request 

Processes the INTinclude-scripts and substitute in content.

Takes $this->content, and splits the content by and then puts the content back together.

array$nonCacheableData‪$GLOBALS['TSFE']->config['INTincScript'] or part of it
See also

Definition at line 2021 of file TypoScriptFrontendController.php.

References TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\getTimeTracker().

Referenced by TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\recursivelyReplaceIntPlaceholdersInContent().

◆ recursivelyReplaceIntPlaceholdersInContent()

TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::recursivelyReplaceIntPlaceholdersInContent ( ServerRequestInterface  $request)

Replaces INT placeholders (COA_INT and USER_INT) in $this->content In case the replacement adds additional placeholders, it loops until no new placeholders are found any more.

Definition at line 2000 of file TypoScriptFrontendController.php.

References TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\processNonCacheableContentPartsAndSubstituteContentMarkers().

Referenced by TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\INTincScript().

◆ releaseLocks()

TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::releaseLocks ( )

Release the page specific lock.


Definition at line 2402 of file TypoScriptFrontendController.php.

Referenced by TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\getFromCache().

◆ resolveContentPid()

int TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::resolveContentPid ( ServerRequestInterface  $request)

Check the value of "content_from_pid" of the current page record, and see if the current request should actually show content from another page.

By using $TSFE->getPageAndRootline() on the cloned object, all rootline restrictions (extendToSubPages) are evaluated as well.

‪int the current page ID or another one if resolved properly - usually set to $this->contentPid

Definition at line 1801 of file TypoScriptFrontendController.php.

References TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$id.

Referenced by TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\determineId().

◆ set_cache_timeout_default()

TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::set_cache_timeout_default (   $seconds)

Sets the cache-timeout in seconds

int$seconds‪Cache-timeout in seconds

Definition at line 2345 of file TypoScriptFrontendController.php.

◆ set_no_cache()

TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::set_no_cache (   $reason = '',
  $internalRequest = false 

Sets the cache-flag to 1. Could be called from user-included php-files in order to ensure that a page is not cached.

string$reason‪An optional reason to be written to the log.
bool$internalRequest‪Whether the request is internal or not (true should only be used by core calls).

Definition at line 2296 of file TypoScriptFrontendController.php.

References $GLOBALS, TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\disableCache(), TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\getTimeTracker(), and TYPO3\CMS\Core\TimeTracker\TimeTracker\setTSlogMessage().

Referenced by TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\getFromCache().

◆ setAbsRefPrefix()

TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::setAbsRefPrefix ( )

◆ setContentType()

TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::setContentType (   $contentType)

Must only be used by TYPO3 core

Definition at line 455 of file TypoScriptFrontendController.php.

◆ setPageArguments()

TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::setPageArguments ( PageArguments  $pageArguments)

◆ setPageCacheContent()

TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::setPageCacheContent ( string  $content,
array  $data,
int  $expirationTstamp 

Sets cache content; Inserts the content string into the pages cache.

string$content‪The content to store in the HTML field of the cache table
array$data‪The additional cache_data array, fx. $this->config
int$expirationTstamp‪Expiration timestamp
See also

Definition at line 1700 of file TypoScriptFrontendController.php.

References TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$contentPid, $GLOBALS, and TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$id.

Referenced by TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\generatePage_postProcessing().

◆ setRegisterValueForSysLastChanged()

TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::setRegisterValueForSysLastChanged ( array  $page)

Set the SYS_LASTCHANGED register value, is also called when a translated page is in use, so the register reflects the state of the translated page, not the page in the default language.

See also

Definition at line 1767 of file TypoScriptFrontendController.php.

References TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$page.

Referenced by TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\determineId().

◆ setSysLastChanged()

TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::setSysLastChanged ( )

Setting the SYS_LASTCHANGED value in the pagerecord: This value will thus be set to the highest tstamp of records rendered on the page. This includes all records with no regard to hidden records, userprotection and so on.

The important part is that this actually updates a translated "pages" record (_PAGES_OVERLAY_UID) if the Frontend is called with a translation.

See also

Definition at line 1737 of file TypoScriptFrontendController.php.

References TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$id.

Referenced by TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\generatePage_postProcessing().

◆ settingLanguage()

◆ shouldAcquireCacheData()

bool TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::shouldAcquireCacheData ( ServerRequestInterface  $request)

Detecting if shift-reload has been clicked. This option will have no effect if re-generation of page happens by other reasons (for instance that the page is not in cache yet). Also, a backend user MUST be logged in for the shift-reload to be detected due to DoS-attack-security reasons.

‪bool If shift-reload in client browser has been clicked, disable getting cached page and regenerate the page content.

Definition at line 1419 of file TypoScriptFrontendController.php.

Referenced by TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\getFromCache().

◆ sL()

string TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::sL (   $input)

Split Label function for front-end applications.

string$input‪Key string. Accepts the "LLL:" prefix.
‪string Label value, if any.

Definition at line 2379 of file TypoScriptFrontendController.php.

References TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\language.

◆ uniqueHash()

string TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::uniqueHash (   $str = '')

Returns a unique md5 hash. There is no special magic in this, the only point is that you don't have to call md5(uniqid()) which is slow and by this you are sure to get a unique string each time in a little faster way.

string$str‪Some string to include in what is hashed. Not significant at all.
‪string MD5 hash of ->uniqueString, input string and uniqueCounter

Definition at line 2285 of file TypoScriptFrontendController.php.

References TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\uniqueString.

Referenced by TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\INTincScript_loadJSCode(), and TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\stdWrap_postUserFuncInt().

◆ updateRootLinesWithTranslations()

TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::updateRootLinesWithTranslations ( )

Updating content of the two rootLines IF the language key is set!

Definition at line 1583 of file TypoScriptFrontendController.php.

Referenced by TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\settingLanguage().

Member Data Documentation

◆ $contentPid

int TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::$contentPid = 0

This will normally point to the same value as id, but can be changed to point to another page from which content will then be displayed instead.

Definition at line 161 of file TypoScriptFrontendController.php.

Referenced by TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\setPageCacheContent().

◆ $fe_user

FrontendUserAuthentication TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::$fe_user

The frontend user

Definition at line 201 of file TypoScriptFrontendController.php.

◆ $id

◆ $language

SiteLanguage TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::$language

◆ $MP

string TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::$MP = ''

Definition at line 195 of file TypoScriptFrontendController.php.

◆ $no_cache

bool TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::$no_cache = false

Page will not be cached. Write only TRUE. Never clear value (some other code might have reasons to set it TRUE).

Definition at line 124 of file TypoScriptFrontendController.php.

◆ $originalMountPointPage

array TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::$originalMountPointPage = null

Gets set when we are processing a page of type mountpoint with enabled overlay in getPageAndRootline() Used later in checkPageForMountpointRedirect() to determine the final target URL where the user should be redirected to.

Definition at line 168 of file TypoScriptFrontendController.php.

◆ $originalShortcutPage

array TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::$originalShortcutPage = null

Gets set when we are processing a page of type shortcut in the early stages of the request, used later in the request to resolve the shortcut and redirect again.

Definition at line 174 of file TypoScriptFrontendController.php.

◆ $page

◆ $pageAccessFailureHistory

array TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::$pageAccessFailureHistory = []

Array containing a history of why a requested page was not accessible.

Definition at line 190 of file TypoScriptFrontendController.php.

◆ $pageArguments

◆ $pageNotFound

int TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::$pageNotFound = 0

Is set to > 0 if the page could not be resolved. This will then result in early returns when resolving the page.

Definition at line 185 of file TypoScriptFrontendController.php.

◆ $rootLine

array TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::$rootLine = []

◆ $site

◆ $sys_page

PageRepository string TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::$sys_page = ''

sys_page-object, pagefunctions

Definition at line 180 of file TypoScriptFrontendController.php.

◆ fe_user

$this TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::fe_user = $frontendUser

◆ language

◆ site

◆ uniqueString

$this TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::uniqueString = md5(microtime())