TypoScriptFrontendController implements LoggerAwareInterface uses LoggerAwareTrait, PublicPropertyDeprecationTrait
Class for the built TypoScript based frontend. Instantiated in \TYPO3\CMS\Frontend\Http\RequestHandler as the global object TSFE.
Main frontend class, instantiated in \TYPO3\CMS\Frontend\Http\RequestHandler as the global object TSFE.
This class has a lot of functions and internal variable which are used from \TYPO3\CMS\Frontend\Http\RequestHandler
The class is instantiated as $GLOBALS['TSFE'] in \TYPO3\CMS\Frontend\Http\RequestHandler.
The use of this class should be inspired by the order of function calls as found in \TYPO3\CMS\Frontend\Http\RequestHandler.
Table of Contents
Interfaces
- LoggerAwareInterface
Properties
- $absRefPrefix : string
- Absolute Reference prefix
- $accessKey : array<string|int, mixed>
- Used by class \TYPO3\CMS\Frontend\ContentObject\Menu\AbstractMenuContentObject to keep track of access-keys.
- $additionalFooterData : array<string|int, mixed>
- Used to accumulate additional HTML-code for the footer-section of the template
- $additionalHeaderData : array<string|int, mixed>
- Eg. insert JS-functions in this array ($additionalHeaderData) to include them once. Use associative keys.
- $all : array<string|int, mixed>
- Used by template fetching system. This array is an identification of the template. If $this->all is empty it's because the template-data is not cached, which it must be.
- $applicationData : array<string|int, mixed>
- 'Global' Storage for various applications. Keys should be 'tx_'.extKey for extensions.
- $baseUrl : string
- The base URL set for the page header.
- $cObj : ContentObjectRenderer
- Page content render object
- $cObjectDepthCounter : int
- Checking that the function is not called eternally. This is done by interrupting at a depth of 50
- $config : array<string|int, mixed>
- "CONFIG" object from TypoScript. Array generated based on the TypoScript configuration of the current page. Saved with the cached pages.
- $content : string
- All page content is accumulated in this variable. See RequestHandler
- $contentPid : int
- 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.
- $currentRecord : string
- This is set to the [table]:[uid] of the latest record rendered. Note that class ContentObjectRenderer has an equal value, but that is pointing to the record delivered in the $data-array of the ContentObjectRenderer instance, if the cObjects CONTENT or RECORD created that instance
- $displayEditIcons : string
- If set, edit icons are rendered aside content records. Must be set only if the ->beUserLogin flag is set and set_no_cache() must be called as well.
- $displayFieldEditIcons : string
- If set, edit icons are rendered aside individual fields of content. Must be set only if the ->beUserLogin flag is set and set_no_cache() must be called as well.
- $extTarget : string
- Default external target
- $fe_user : FrontendUserAuthentication
- The frontend user
- $fileTarget : string
- Default file link target
- $id : string|int
- The page id (int)
- $indexedDocTitle : string
- This value will be used as the title for the page in the indexer (if indexing happens)
- $intTarget : string
- Default internal target
- $lastImgResourceInfo : array<string|int, mixed>|null
- Info-array of the last resulting image resource of content object IMG_RESOURCE (if any), containing width, height and so on.
- $linkVars : string
- A string prepared for insertion in all links on the page as url-parameters.
- $metaCharset : string
- Output charset of the websites content. This is the charset found in the header, meta tag etc. If different than utf-8 a conversion happens before output to browser. Defaults to utf-8.
- $MP : string
- $newHash : string
- This hash is unique to the template, the $this->id and $this->type vars and the list of groups. Used to get and later store the cached data
- $no_cache : bool
- Page will not be cached. Write only TRUE. Never clear value (some other code might have reasons to set it TRUE).
- $page : array<string|int, mixed>
- The pagerecord
- $pageNotFound : int
- Is set to 1 if a pageNotFound handler could have been called.
- $pSetup : array<string|int, mixed>|string
- TypoScript configuration of the page-object pointed to by sPre.
- $recordRegister : array<string|int, mixed>
- Used by RecordContentObject and ContentContentObject to ensure the a records is NOT rendered twice through it!
- $register : array<string|int, mixed>
- $registerStack : array<string|int, mixed>
- Stack used for storing array and retrieving register arrays (see LOAD_REGISTER and RESTORE_REGISTER)
- $rootLine : array<string|int, mixed>
- The rootLine (all the way to tree root, not only the current site!)
- $simUserGroup : int
- Value that contains the simulated usergroup if any
- $spamProtectEmailAddresses : string|int
- If set, typolink() function encrypts email addresses.
- $sPre : string
- Toplevel - objArrayName, eg 'page'
- $sWordList : string
- Is set to the incoming array sword_list in case of a page-view jumped to from a search-result.
- $sWordRegEx : string
- Search word regex, calculated if there has been search-words send. This is used to mark up the found search words on a page when jumped to from a link in a search-result.
- $sys_page : PageRepository|string
- sys_page-object, pagefunctions
- $tmpl : TemplateService
- The TypoScript template object. Used to parse the TypoScript template
- $type : int|string
- The type (read-only)
- $xhtmlDoctype : string
- Doctype to use
- $xhtmlVersion : int
- $ATagParams : string
- <A>-tag parameters
- $cacheContentFlag : bool
- Set internally if cached content is fetched from the database.
- $cacheExpires : int
- Set to the expire time of cached content
- $cacheTimeOutDefault : int
- Is set to the time-to-live time of cached pages. Default is 60*60*24, which is 24 hours.
- $contentType : string
- Content type HTTP header being sent in the request.
- $context : Context
- The context for keeping the current state, mostly related to current page information, backend user / frontend user access, workspaceId
- $debugInformationHeader : string
- If debug mode is enabled, this contains the information if a page is fetched from cache, and sent as HTTP Response Header.
- $isClientCachable : bool
- Set if cache headers allowing caching are sent.
- $language : SiteLanguage
- $languageService : LanguageService
- Internal calculations for labels
- $locks : array<string|int, array<string|int, LockingStrategyInterface>>
- $loginAllowedInBranch : bool
- Shows whether logins are allowed in branch
- $loginAllowedInBranch_mode : string
- Shows specific mode (all or groups)
- $no_cacheBeforePageGen : bool
- This flag is set before the page is generated IF $this->no_cache is set. If this flag is set after the page content was generated, $this->no_cache is forced to be set.
- $originalMountPointPage : array<string|int, mixed>|null
- Gets set when we are processing a page of type mounpoint with enabled overlay in getPageAndRootline() Used later in checkPageForMountpointRedirect() to determine the final target URL where the user should be redirected to.
- $originalShortcutPage : array<string|int, mixed>|null
- Gets set when we are processing a page of type shortcut in the early stages of the request when we do not know about languages yet, used later in the request to determine the correct shortcut in case a translation changes the shortcut target
- $pageAccessFailureHistory : array<string|int, mixed>
- Array containing a history of why a requested page was not accessible.
- $pageArguments : PageArguments
- $pageCache : FrontendInterface
- The page cache object, use this to save pages to the cache and to retrieve them again
- $pageCacheTags : array<string|int, mixed>
- $pageRenderer : PageRenderer
- $pagesTSconfig : array<string|int, mixed>|string
- May be set to the pagesTSconfig
- $requestedId : int
- Originally requested id from the initial $_GET variable
- $site : SiteInterface
- $uniqueCounter : int
- Used to generate page-unique keys. Point is that uniqid() functions is very slow, so a unikey key is made based on this, see function uniqueHash()
- $uniqueString : string
Methods
- __construct() : mixed
- Since TYPO3 v10.0, TSFE is composed out of - Context - Site - SiteLanguage - PageArguments (containing ID, Type, cHash and MP arguments)
- __get() : mixed
- Gets the value of the property of the given name if tagged.
- __isset() : bool
- Checks if the property of the given name is set.
- __set() : mixed
- Sets the property of the given name if tagged.
- __unset() : mixed
- Unsets the property of the given name if tagged.
- addCacheTags() : mixed
- Adds tags to this page's cache entry, you can then f.e. remove cache entries by tag
- applyHttpHeadersToResponse() : ResponseInterface
- Add HTTP headers to the response object.
- baseUrlWrap() : string
- Prefixing the input URL with ->baseUrl If ->baseUrl is set and the input url is not absolute in some way.
- calculateLinkVars() : mixed
- Calculates and sets the internal linkVars based upon the current request parameters and the setting "config.linkVars".
- checkEnableFields() : bool
- Checks page record for enableFields Returns TRUE if enableFields does not disable the page record.
- checkIfLoginAllowedInBranch() : bool
- Checks if logins are allowed in the current branch of the page tree. Traverses the full root line and returns TRUE if logins are OK, otherwise FALSE (and then the login user must be unset!)
- checkPageGroupAccess() : bool
- Check group access against a page record
- checkPagerecordForIncludeSection() : bool
- Checks if the current page of the root line is visible.
- clear_preview() : mixed
- Clears the preview-flags, sets sim_exec_time to current time.
- clearPageCacheContent() : mixed
- Clears cache content (for $this->newHash)
- convOutputCharset() : string
- Converts input string from utf-8 to metaCharset IF the two charsets are different.
- determineId() : mixed
- Determines the id and evaluates any preview settings Basically this function is about determining whether a backend user is logged in, if he has read access to the page and if he's previewing the page.
- doWorkspacePreview() : bool
- Returns TRUE if workspace preview is enabled
- generatePage_postProcessing() : mixed
- Does processing of the content after the page content was generated.
- generatePage_preProcessing() : mixed
- Does some processing BEFORE the page content is generated / built.
- generatePageTitle() : string
- Generate the page title, can be called multiple times, as PageTitleProvider might have been modified by an uncached plugin etc.
- get_cache_timeout() : int
- Get the cache timeout for the current page.
- getConfigArray() : mixed
- Checks if config-array exists already but if not, gets it
- getContext() : Context
- getFromCache() : mixed
- See if page is in cache and get it if so Stores the page content in $this->content if something is found.
- getFromCache_queryRow() : array<string|int, mixed>
- Returning the cached version of page with hash = newHash
- getGlobalInstance() : TypoScriptFrontendController
- Return the global instance of this class.
- getLanguage() : SiteLanguage
- getPageAccessFailureReasons() : array<string|int, mixed>
- 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
- getPageArguments() : PageArguments
- getPageCacheTags() : array<string|int, mixed>
- getPagesTSconfig() : array<string|int, mixed>
- Returns the pages TSconfig array based on the current ->rootLine
- getRedirectUriForMountPoint() : string|null
- Returns URI of target page, if the current page is an overlaid mountpoint.
- getRedirectUriForShortcut() : string|null
- Returns URI of target page, if the current page is a Shortcut.
- getRequestedId() : int
- Fetches the originally requested id, falls back to $this->id
- getSite() : SiteInterface
- headerNoCache() : bool
- Detecting if shift-reload has been clicked Will not be called 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.
- initUserGroups() : mixed
- Initializes the front-end user groups.
- INTincScript() : mixed
- Processes the INTinclude-scripts
- INTincScript_loadJSCode() : mixed
- Loads the JavaScript/CSS code for INTincScript, if there are non-cacheable content objects it prepares the placeholders, otherwise populates options directly.
- isBackendUserLoggedIn() : bool
- Checks if a backend user is logged in
- isGeneratePage() : bool
- Returns TRUE if the page should be generated.
- isINTincScript() : bool
- Determines if there are any INTincScripts to include = "non-cacheable" parts
- isStaticCacheble() : bool
- Reporting status whether we can send cache control headers for proxy caching or publishing to static files
- isUserOrGroupSet() : bool
- Checking if a user is logged in or a group constellation different from "0,-1"
- logDeprecatedTyposcript() : mixed
- Logs access to deprecated TypoScript objects and properties.
- newCObj() : mixed
- Creates an instance of ContentObjectRenderer in $this->cObj This instance is used to start the rendering of the TypoScript template structure
- preparePageContentGeneration() : mixed
- Sets up TypoScript "config." options and set properties in $TSFE.
- releaseLocks() : mixed
- Release pending locks
- set_cache_timeout_default() : mixed
- Sets the cache-timeout in seconds
- set_no_cache() : mixed
- Sets the cache-flag to 1. Could be called from user-included php-files in order to ensure that a page is not cached.
- setContentType() : mixed
- sL() : string
- Split Label function for front-end applications.
- uniqueHash() : string
- Returns a unique md5 hash.
- whichWorkspace() : int
- Returns the uid of the current workspace
- acquireLock() : mixed
- Acquire a page specific lock
- applyPreviewSettings() : string|null
- Evaluates admin panel or workspace settings to see if visibility settings like - Preview Aspect: isPreview - Visibility Aspect: includeHiddenPages - Visibility Aspect: includeHiddenContent - $simUserGroup should be applied to the current object.
- calculatePageCacheTimeout() : int
- Calculates page cache timeout according to the records with starttime/endtime on the page.
- checkRootlineForIncludeSection() : bool
- Checks if visibility of the page is blocked upwards in the root line.
- checkTranslatedShortcut() : mixed
- Checks whether a translated shortcut page has a different shortcut target than the original language page.
- createHashBase() : string
- Calculates the cache-hash (or the lock-hash) This hash is unique to the template, the variables ->id, ->type, list of frontend user groups, ->MP (Mount Points) and cHash array Used to get and later store the cached data.
- determineIdIsHiddenPage() : bool
- Checks if the page is hidden in the active workspace.
- disableCache() : mixed
- Disables caching of the current page.
- fetch_the_id() : mixed
- Resolves the page id and sets up several related properties.
- getAdditionalHeaders() : array<string|int, mixed>
- Send additional headers from config.additionalHeaders
- getBackendUser() : FrontendBackendUserAuthentication|null
- Returns the current BE user.
- getCacheHeaders() : array<string|int, mixed>
- Get cache headers good for client/reverse proxy caching.
- getCurrentPageCacheConfiguration() : array<string|int, mixed>
- Obtains a list of table/pid pairs to consider for page caching.
- getFirstTimeValueForRecord() : int
- Find the minimum starttime or endtime value in the table and pid that is greater than the current time.
- getHash() : string
- Calculates the cache-hash This hash is unique to the template, the variables ->id, ->type, list of fe user groups, ->MP (Mount Points) and cHash array Used to get and later store the cached data.
- getLockHash() : string
- Calculates the lock-hash This hash is unique to the above hash, except that it doesn't contain the template information in $this->all.
- getPageAndRootline() : mixed
- Loads the page and root line records based on $this->id
- getPageAndRootlineWithDomain() : mixed
- Gets ->page and ->rootline information based on ->id. ->id may change during this operation.
- getRelevantParametersForCachingFromPageArguments() : array<string|int, mixed>
- Fetches the arguments that are relevant for creating the hash base from the given PageArguments object.
- getTimeTracker() : TimeTracker
- getUriToCurrentPageForRedirect() : string
- Instantiate \TYPO3\CMS\Frontend\ContentObject to generate the correct target URL
- getWebsiteTitle() : string
- initCaches() : mixed
- Initializes the caching system.
- initializeSearchWordData() : mixed
- Fills the sWordList property and builds the regular expression in TSFE that can be used to split strings by the submitted search words.
- initPageRenderer() : mixed
- Initializes the page renderer object
- isAllowedLinkVarValue() : bool
- Checks if the value defined in "config.linkVars" contains an allowed value.
- isInPreviewMode() : bool
- logPageAccessFailure() : void
- Log the page access failure with additional request information
- populatePageDataFromCache() : void
- 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.
- prepareDebugInformationForCachedPage() : void
- printTitle() : string
- Compiles the content for the page <title> tag.
- processNonCacheableContentPartsAndSubstituteContentMarkers() : mixed
- Processes the INTinclude-scripts and substitute in content.
- realPageCacheContent() : mixed
- Set cache content to $this->content
- recursivelyReplaceIntPlaceholdersInContent() : mixed
- 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.
- releaseLock() : mixed
- Release a page specific lock
- resolveContentPid() : int
- 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.
- resolveTranslatedPageId() : mixed
- If $this->id contains a translated page record, this needs to be resolved to the default language in order for all rootline functionality and access restrictions to be in place further on.
- setAbsRefPrefix() : mixed
- Converts relative paths in the HTML source to absolute paths for fileadmin/, typo3conf/ext/ and media/ folders.
- setOutputLanguage() : mixed
- Sets all internal measures what language the page should be rendered.
- setPageArguments() : void
- setPageCacheContent() : mixed
- Sets cache content; Inserts the content string into the cache_pages cache.
- setRegisterValueForSysLastChanged() : void
- 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.
- setSysLastChanged() : mixed
- Sets sys last changed 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.
- settingLanguage() : mixed
- Setting the language key that will be used by the current page.
- splitLinkVarsString() : array<string|int, mixed>
- Split the link vars string by "," but not if the "," is inside of braces
- unsetBackendUser() : void
- updateRootLinesWithTranslations() : mixed
- Updating content of the two rootLines IF the language key is set!
Properties
$absRefPrefix
Absolute Reference prefix
public
string
$absRefPrefix
= ''
$accessKey
Used by class \TYPO3\CMS\Frontend\ContentObject\Menu\AbstractMenuContentObject to keep track of access-keys.
public
array<string|int, mixed>
$accessKey
= []
$additionalFooterData
Used to accumulate additional HTML-code for the footer-section of the template
public
array<string|int, mixed>
$additionalFooterData
= []
$additionalHeaderData
Eg. insert JS-functions in this array ($additionalHeaderData) to include them once. Use associative keys.
public
array<string|int, mixed>
$additionalHeaderData
= []
Keys in use:
used to accumulate additional HTML-code for the header-section,
.... Insert either associative keys (like additionalHeaderData['myStyleSheet'], see reserved keys above) or num-keys (like additionalHeaderData[] = '...')$all
Used by template fetching system. This array is an identification of the template. If $this->all is empty it's because the template-data is not cached, which it must be.
public
array<string|int, mixed>
$all
= []
$applicationData
'Global' Storage for various applications. Keys should be 'tx_'.extKey for extensions.
public
array<string|int, mixed>
$applicationData
= []
$baseUrl
The base URL set for the page header.
public
string
$baseUrl
= ''
$cObj
Page content render object
public
ContentObjectRenderer
$cObj
$cObjectDepthCounter
Checking that the function is not called eternally. This is done by interrupting at a depth of 50
since v11, will be removed in v12.
public
int
$cObjectDepthCounter
= 50
$config
"CONFIG" object from TypoScript. Array generated based on the TypoScript configuration of the current page. Saved with the cached pages.
public
array<string|int, mixed>
$config
= []
$content
All page content is accumulated in this variable. See RequestHandler
public
string
$content
= ''
$contentPid
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.
public
int
$contentPid
= 0
$currentRecord
This is set to the [table]:[uid] of the latest record rendered. Note that class ContentObjectRenderer has an equal value, but that is pointing to the record delivered in the $data-array of the ContentObjectRenderer instance, if the cObjects CONTENT or RECORD created that instance
public
string
$currentRecord
= ''
$displayEditIcons
If set, edit icons are rendered aside content records. Must be set only if the ->beUserLogin flag is set and set_no_cache() must be called as well.
since v11, will be removed with v12. Drop together with editPanel removal.
public
string
$displayEditIcons
= ''
$displayFieldEditIcons
If set, edit icons are rendered aside individual fields of content. Must be set only if the ->beUserLogin flag is set and set_no_cache() must be called as well.
since v11, will be removed with v12. Drop together with editIcons removal.
public
string
$displayFieldEditIcons
= ''
$extTarget
Default external target
public
string
$extTarget
= ''
$fe_user
The frontend user
public
FrontendUserAuthentication
$fe_user
$fileTarget
Default file link target
public
string
$fileTarget
= ''
$id
The page id (int)
public
string|int
$id
= ''
$indexedDocTitle
This value will be used as the title for the page in the indexer (if indexing happens)
public
string
$indexedDocTitle
= ''
only used by TYPO3 Core, use PageTitle API instead.
$intTarget
Default internal target
public
string
$intTarget
= ''
$lastImgResourceInfo
Info-array of the last resulting image resource of content object IMG_RESOURCE (if any), containing width, height and so on.
public
array<string|int, mixed>|null
$lastImgResourceInfo
= null
$linkVars
A string prepared for insertion in all links on the page as url-parameters.
public
string
$linkVars
= ''
Based on configuration in TypoScript where you defined which GET_VARS you would like to pass on.
$metaCharset
Output charset of the websites content. This is the charset found in the header, meta tag etc. If different than utf-8 a conversion happens before output to browser. Defaults to utf-8.
public
string
$metaCharset
= 'utf-8'
$MP
public
string
$MP
= ''
$newHash
This hash is unique to the template, the $this->id and $this->type vars and the list of groups. Used to get and later store the cached data
public
string
$newHash
= ''
$no_cache
Page will not be cached. Write only TRUE. Never clear value (some other code might have reasons to set it TRUE).
public
bool
$no_cache
= false
$page
The pagerecord
public
array<string|int, mixed>
$page
= []
$pageNotFound
Is set to 1 if a pageNotFound handler could have been called.
public
int
$pageNotFound
= 0
$pSetup
TypoScript configuration of the page-object pointed to by sPre.
public
array<string|int, mixed>|string
$pSetup
= ''
$this->tmpl->setup[$this->sPre.'.']
should only be used by TYPO3 Core
$recordRegister
Used by RecordContentObject and ContentContentObject to ensure the a records is NOT rendered twice through it!
public
array<string|int, mixed>
$recordRegister
= []
$register
public
array<string|int, mixed>
$register
= []
$registerStack
Stack used for storing array and retrieving register arrays (see LOAD_REGISTER and RESTORE_REGISTER)
public
array<string|int, mixed>
$registerStack
= []
$rootLine
The rootLine (all the way to tree root, not only the current site!)
public
array<string|int, mixed>
$rootLine
= []
$simUserGroup
Value that contains the simulated usergroup if any
public
int
$simUserGroup
= 0
only to be used in AdminPanel, and within TYPO3 Core
$spamProtectEmailAddresses
If set, typolink() function encrypts email addresses.
public
string|int
$spamProtectEmailAddresses
= 0
$sPre
Toplevel - objArrayName, eg 'page'
public
string
$sPre
= ''
should only be used by TYPO3 Core
$sWordList
Is set to the incoming array sword_list in case of a page-view jumped to from a search-result.
public
string
$sWordList
= ''
$sWordRegEx
Search word regex, calculated if there has been search-words send. This is used to mark up the found search words on a page when jumped to from a link in a search-result.
public
string
$sWordRegEx
= ''
$sys_page
sys_page-object, pagefunctions
public
PageRepository|string
$sys_page
= ''
$tmpl
The TypoScript template object. Used to parse the TypoScript template
public
TemplateService
$tmpl
$type
The type (read-only)
public
int|string
$type
= ''
$xhtmlDoctype
Doctype to use
public
string
$xhtmlDoctype
= ''
$xhtmlVersion
public
int
$xhtmlVersion
$ATagParams
<A>-tag parameters
will be removed in TYPO3 v12.0. Use TSFE->config[config][ATagParams] directly.
protected
string
$ATagParams
= ''
$cacheContentFlag
Set internally if cached content is fetched from the database.
protected
bool
$cacheContentFlag
= false
$cacheExpires
Set to the expire time of cached content
protected
int
$cacheExpires
= 0
$cacheTimeOutDefault
Is set to the time-to-live time of cached pages. Default is 60*60*24, which is 24 hours.
protected
int
$cacheTimeOutDefault
= 86400
$contentType
Content type HTTP header being sent in the request.
protected
string
$contentType
= 'text/html'
Should only be used by TYPO3 core for now
Tags
$context
The context for keeping the current state, mostly related to current page information, backend user / frontend user access, workspaceId
protected
Context
$context
$debugInformationHeader
If debug mode is enabled, this contains the information if a page is fetched from cache, and sent as HTTP Response Header.
protected
string
$debugInformationHeader
= ''
$isClientCachable
Set if cache headers allowing caching are sent.
protected
bool
$isClientCachable
= false
$language
protected
SiteLanguage
$language
$languageService
Internal calculations for labels
protected
LanguageService
$languageService
$locks
protected
array<string|int, array<string|int, LockingStrategyInterface>>
$locks
= []
$loginAllowedInBranch
Shows whether logins are allowed in branch
protected
bool
$loginAllowedInBranch
= true
$loginAllowedInBranch_mode
Shows specific mode (all or groups)
protected
string
$loginAllowedInBranch_mode
= ''
$no_cacheBeforePageGen
This flag is set before the page is generated IF $this->no_cache is set. If this flag is set after the page content was generated, $this->no_cache is forced to be set.
protected
bool
$no_cacheBeforePageGen
= false
This is done in order to make sure that PHP code from Plugins / USER scripts does not falsely clear the no_cache flag.
$originalMountPointPage
Gets set when we are processing a page of type mounpoint with enabled overlay in getPageAndRootline() Used later in checkPageForMountpointRedirect() to determine the final target URL where the user should be redirected to.
protected
array<string|int, mixed>|null
$originalMountPointPage
$originalShortcutPage
Gets set when we are processing a page of type shortcut in the early stages of the request when we do not know about languages yet, used later in the request to determine the correct shortcut in case a translation changes the shortcut target
protected
array<string|int, mixed>|null
$originalShortcutPage
Tags
$pageAccessFailureHistory
Array containing a history of why a requested page was not accessible.
protected
array<string|int, mixed>
$pageAccessFailureHistory
= []
$pageArguments
protected
PageArguments
$pageArguments
$pageCache
The page cache object, use this to save pages to the cache and to retrieve them again
protected
FrontendInterface
$pageCache
$pageCacheTags
protected
array<string|int, mixed>
$pageCacheTags
= []
$pageRenderer
protected
PageRenderer
$pageRenderer
$pagesTSconfig
May be set to the pagesTSconfig
protected
array<string|int, mixed>|string
$pagesTSconfig
= ''
$requestedId
Originally requested id from the initial $_GET variable
protected
int
$requestedId
$site
protected
SiteInterface
$site
$uniqueCounter
Used to generate page-unique keys. Point is that uniqid() functions is very slow, so a unikey key is made based on this, see function uniqueHash()
protected
int
$uniqueCounter
= 0
$uniqueString
protected
string
$uniqueString
= ''
Methods
__construct()
Since TYPO3 v10.0, TSFE is composed out of - Context - Site - SiteLanguage - PageArguments (containing ID, Type, cHash and MP arguments)
public
__construct(Context $context, SiteInterface $site, SiteLanguage $siteLanguage, PageArguments $pageArguments, FrontendUserAuthentication $frontendUser) : mixed
Also sets a unique string (->uniqueString) for this script instance; A md5 hash of the microtime()
Parameters
- $context : Context
-
the Context object to work with
- $site : SiteInterface
-
The resolved site to work with
- $siteLanguage : SiteLanguage
-
The resolved language to work with
- $pageArguments : PageArguments
-
The PageArguments object containing Page ID, type and GET parameters
- $frontendUser : FrontendUserAuthentication
-
a FrontendUserAuthentication object
__get()
Gets the value of the property of the given name if tagged.
public
__get(string $propertyName) : mixed
The evaluation is done in the assumption that this method is never reached for a public property.
Parameters
- $propertyName : string
__isset()
Checks if the property of the given name is set.
public
__isset(string $propertyName) : bool
Unmarked protected properties must return false as usual. Marked properties are evaluated by isset().
This method is not called for public properties.
Parameters
- $propertyName : string
Return values
bool__set()
Sets the property of the given name if tagged.
public
__set(string $propertyName, mixed $propertyValue) : mixed
Additionally it's allowed to set unknown properties.
The evaluation is done in the assumption that this method is never reached for a public property.
Parameters
- $propertyName : string
- $propertyValue : mixed
__unset()
Unsets the property of the given name if tagged.
public
__unset(string $propertyName) : mixed
Parameters
- $propertyName : string
addCacheTags()
Adds tags to this page's cache entry, you can then f.e. remove cache entries by tag
public
addCacheTags(array<string|int, mixed> $tags) : mixed
Parameters
- $tags : array<string|int, mixed>
-
An array of tag
applyHttpHeadersToResponse()
Add HTTP headers to the response object.
public
applyHttpHeadersToResponse(ResponseInterface $response) : ResponseInterface
Parameters
- $response : ResponseInterface
Return values
ResponseInterfacebaseUrlWrap()
Prefixing the input URL with ->baseUrl If ->baseUrl is set and the input url is not absolute in some way.
public
baseUrlWrap(string $url) : string
Designed as a wrapper functions for use with all frontend links that are processed by JavaScript (for "realurl" compatibility!). So each time a URL goes into window.open, window.location.href or otherwise, wrap it with this function!
Parameters
- $url : string
-
Input URL, relative or absolute
Return values
string —Processed input value.
calculateLinkVars()
Calculates and sets the internal linkVars based upon the current request parameters and the setting "config.linkVars".
public
calculateLinkVars(array<string|int, mixed> $queryParams) : mixed
Parameters
- $queryParams : array<string|int, mixed>
-
$_GET (usually called with a PSR-7 $request->getQueryParams())
checkEnableFields()
Checks page record for enableFields Returns TRUE if enableFields does not disable the page record.
public
checkEnableFields(array<string|int, mixed> $row[, bool $bypassGroupCheck = false ]) : bool
Takes notice of the includeHiddenPages visibility aspect flag and uses SIM_ACCESS_TIME for start/endtime evaluation
Parameters
- $row : array<string|int, mixed>
-
The page record to evaluate (needs fields: hidden, starttime, endtime, fe_group)
- $bypassGroupCheck : bool = false
-
Bypass group-check
Tags
Return values
bool —TRUE, if record is viewable.
checkIfLoginAllowedInBranch()
Checks if logins are allowed in the current branch of the page tree. Traverses the full root line and returns TRUE if logins are OK, otherwise FALSE (and then the login user must be unset!)
public
checkIfLoginAllowedInBranch() : bool
Return values
bool —returns TRUE if logins are OK, otherwise FALSE (and then the login user must be unset!)
checkPageGroupAccess()
Check group access against a page record
public
checkPageGroupAccess(array<string|int, mixed> $row) : bool
Parameters
- $row : array<string|int, mixed>
-
The page record to evaluate (needs field: fe_group)
Return values
bool —TRUE, if group access is granted.
checkPagerecordForIncludeSection()
Checks if the current page of the root line is visible.
public
checkPagerecordForIncludeSection(array<string|int, mixed> $row) : bool
If the field extendToSubpages is 0, access is granted, else the fields hidden, starttime, endtime, fe_group are evaluated.
Parameters
- $row : array<string|int, mixed>
-
The page record
Tags
Return values
bool —true if visible
clear_preview()
Clears the preview-flags, sets sim_exec_time to current time.
public
clear_preview() : mixed
Hidden pages must be hidden as default, $GLOBALS['SIM_EXEC_TIME'] is set to $GLOBALS['EXEC_TIME'] in bootstrap initializeGlobalTimeVariables(). Alter it by adding or subtracting seconds.
clearPageCacheContent()
Clears cache content (for $this->newHash)
public
clearPageCacheContent() : mixed
convOutputCharset()
Converts input string from utf-8 to metaCharset IF the two charsets are different.
public
convOutputCharset(string $content) : string
Parameters
- $content : string
-
Content to be converted.
Tags
Return values
string —Converted content string.
determineId()
Determines the id and evaluates any preview settings Basically this function is about determining whether a backend user is logged in, if he has read access to the page and if he's previewing the page.
public
determineId([ServerRequestInterface|null $request = null ]) : mixed
That all determines which id to show and how to initialize the id.
Parameters
- $request : ServerRequestInterface|null = null
doWorkspacePreview()
Returns TRUE if workspace preview is enabled
public
doWorkspacePreview() : bool
Return values
bool —Returns TRUE if workspace preview is enabled
generatePage_postProcessing()
Does processing of the content after the page content was generated.
public
generatePage_postProcessing() : mixed
This includes caching the page, indexing the page (if configured) and setting sysLastChanged
generatePage_preProcessing()
Does some processing BEFORE the page content is generated / built.
public
generatePage_preProcessing() : mixed
generatePageTitle()
Generate the page title, can be called multiple times, as PageTitleProvider might have been modified by an uncached plugin etc.
public
generatePageTitle() : string
Return values
string —the generated page title
get_cache_timeout()
Get the cache timeout for the current page.
public
get_cache_timeout() : int
Return values
int —The cache timeout for the current page.
getConfigArray()
Checks if config-array exists already but if not, gets it
public
getConfigArray([ServerRequestInterface|null $request = null ]) : mixed
Parameters
- $request : ServerRequestInterface|null = null
Tags
getContext()
public
getContext() : Context
Return values
ContextgetFromCache()
See if page is in cache and get it if so Stores the page content in $this->content if something is found.
public
getFromCache([ServerRequestInterface|null $request = null ]) : mixed
Parameters
- $request : ServerRequestInterface|null = null
-
if given this is used to determine values in headerNoCache() instead of the superglobal $_SERVER
Tags
getFromCache_queryRow()
Returning the cached version of page with hash = newHash
public
getFromCache_queryRow() : array<string|int, mixed>
Return values
array<string|int, mixed> —Cached row, if any. Otherwise void.
getGlobalInstance()
Return the global instance of this class.
public
static getGlobalInstance() : TypoScriptFrontendController
Intended to be used as prototype factory for this class, see Services.yaml. This is required as long as TypoScriptFrontendController needs request dependent constructor parameters. Once that has been refactored this factory will be removed.
Return values
TypoScriptFrontendControllergetLanguage()
public
getLanguage() : SiteLanguage
Return values
SiteLanguagegetPageAccessFailureReasons()
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
public
getPageAccessFailureReasons([string $failureReasonCode = null ]) : array<string|int, mixed>
Parameters
- $failureReasonCode : string = null
-
the error code to be attached (optional), see PageAccessFailureReasons list for details
Return values
array<string|int, mixed> —Summary of why page access was not allowed.
getPageArguments()
public
getPageArguments() : PageArguments
Return values
PageArgumentsgetPageCacheTags()
public
getPageCacheTags() : array<string|int, mixed>
Return values
array<string|int, mixed>getPagesTSconfig()
Returns the pages TSconfig array based on the current ->rootLine
public
getPagesTSconfig() : array<string|int, mixed>
Return values
array<string|int, mixed>getRedirectUriForMountPoint()
Returns URI of target page, if the current page is an overlaid mountpoint.
public
getRedirectUriForMountPoint(ServerRequestInterface $request) : string|null
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.
Parameters
- $request : ServerRequestInterface
Return values
string|nullgetRedirectUriForShortcut()
Returns URI of target page, if the current page is a Shortcut.
public
getRedirectUriForShortcut(ServerRequestInterface $request) : string|null
If the current page is of type shortcut and accessed directly via its URL, the user will be redirected to shortcut target.
Parameters
- $request : ServerRequestInterface
Return values
string|nullgetRequestedId()
Fetches the originally requested id, falls back to $this->id
public
getRequestedId() : int
Tags
Return values
int —the originally requested page uid
getSite()
public
getSite() : SiteInterface
Return values
SiteInterfaceheaderNoCache()
Detecting if shift-reload has been clicked Will not be called 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.
public
headerNoCache([ServerRequestInterface|null $request = null ]) : bool
Parameters
- $request : ServerRequestInterface|null = null
Return values
bool —If shift-reload in client browser has been clicked, disable getting cached page (and regenerate it).
initUserGroups()
Initializes the front-end user groups.
public
initUserGroups() : mixed
Sets frontend.user aspect based on front-end user status.
INTincScript()
Processes the INTinclude-scripts
public
INTincScript([ServerRequestInterface|null $request = null ]) : mixed
Parameters
- $request : ServerRequestInterface|null = null
INTincScript_loadJSCode()
Loads the JavaScript/CSS code for INTincScript, if there are non-cacheable content objects it prepares the placeholders, otherwise populates options directly.
public
INTincScript_loadJSCode() : mixed
this method should be renamed as it does not only handle JS, but all additional header data
isBackendUserLoggedIn()
Checks if a backend user is logged in
public
isBackendUserLoggedIn() : bool
Return values
bool —whether a backend user is logged in
isGeneratePage()
Returns TRUE if the page should be generated.
public
isGeneratePage() : bool
That is if no URL handler is active and the cacheContentFlag is not set.
Return values
boolisINTincScript()
Determines if there are any INTincScripts to include = "non-cacheable" parts
public
isINTincScript() : bool
Return values
bool —Returns TRUE if scripts are found
isStaticCacheble()
Reporting status whether we can send cache control headers for proxy caching or publishing to static files
public
isStaticCacheble() : bool
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)
Return values
boolisUserOrGroupSet()
Checking if a user is logged in or a group constellation different from "0,-1"
public
isUserOrGroupSet() : bool
Return values
bool —TRUE if either a login user is found (array fe_user->user) OR if the gr_list is set to something else than '0,-1' (could be done even without a user being logged in!)
logDeprecatedTyposcript()
Logs access to deprecated TypoScript objects and properties.
public
logDeprecatedTyposcript(string $typoScriptProperty[, string $explanation = '' ]) : mixed
Dumps message to the TypoScript message log (admin panel) and the TYPO3 deprecation log.
Parameters
- $typoScriptProperty : string
-
Deprecated object or property
- $explanation : string = ''
-
Message or additional information
newCObj()
Creates an instance of ContentObjectRenderer in $this->cObj This instance is used to start the rendering of the TypoScript template structure
public
newCObj([ServerRequestInterface|null $request = null ]) : mixed
Parameters
- $request : ServerRequestInterface|null = null
preparePageContentGeneration()
Sets up TypoScript "config." options and set properties in $TSFE.
public
preparePageContentGeneration(ServerRequestInterface $request) : mixed
Parameters
- $request : ServerRequestInterface
releaseLocks()
Release pending locks
public
releaseLocks() : mixed
set_cache_timeout_default()
Sets the cache-timeout in seconds
public
set_cache_timeout_default(int $seconds) : mixed
Parameters
- $seconds : int
-
Cache-timeout in seconds
set_no_cache()
Sets the cache-flag to 1. Could be called from user-included php-files in order to ensure that a page is not cached.
public
set_no_cache([string $reason = '' ][, bool $internalRequest = false ]) : mixed
Parameters
- $reason : string = ''
-
An optional reason to be written to the log.
- $internalRequest : bool = false
-
Whether the request is internal or not (true should only be used by core calls).
setContentType()
public
setContentType(string $contentType) : mixed
Parameters
- $contentType : string
Must only be used by TYPO3 core
sL()
Split Label function for front-end applications.
public
sL(string $input) : string
Parameters
- $input : string
-
Key string. Accepts the "LLL:" prefix.
Return values
string —Label value, if any.
uniqueHash()
Returns a unique md5 hash.
public
uniqueHash([string $str = '' ]) : string
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.
Parameters
- $str : string = ''
-
Some string to include in what is hashed. Not significant at all.
Return values
string —MD5 hash of ->uniqueString, input string and uniqueCounter
whichWorkspace()
Returns the uid of the current workspace
public
whichWorkspace() : int
Return values
int —returns workspace integer for which workspace is being preview. 0 if none (= live workspace).
acquireLock()
Acquire a page specific lock
protected
acquireLock(string $type, string $key) : mixed
The schematics here is:
- First acquire an access lock. This is using the type of the requested lock as key. Since the number of types is rather limited we can use the type as key as it will only eat up a limited number of lock resources on the system (files, semaphores)
- Second, we acquire the actual lock (named page lock). We can be sure we are the only process at this very moment, hence we either get the lock for the given key or we get an error as we request a non-blocking mode.
Interleaving two locks is extremely important, because the actual page lock uses a hash value as key (see callers of this function). If we would simply employ a normal blocking lock, we would get a potentially unlimited (number of pages at least) number of different locks. Depending on the available locking methods on the system we might run out of available resources. (e.g. maximum limit of semaphores is a system setting and applies to the whole system) We therefore must make sure that page locks are destroyed again if they are not used anymore, such that we never use more locking resources than parallel requests to different pages (hashes). In order to ensure this, we need to guarantee that no other process is waiting on a page lock when the process currently having the lock on the page lock is about to release the lock again. This can only be achieved by using a non-blocking mode, such that a process is never put into wait state by the kernel, but only checks the availability of the lock. The access lock is our guard to be sure that no two processes are at the same time releasing/destroying a page lock, whilst the other one tries to get a lock for this page lock. The only drawback of this implementation is that we basically have to poll the availability of the page lock.
Note that the access lock resources are NEVER deleted/destroyed, otherwise the whole thing would be broken.
Parameters
- $type : string
- $key : string
Tags
applyPreviewSettings()
Evaluates admin panel or workspace settings to see if visibility settings like - Preview Aspect: isPreview - Visibility Aspect: includeHiddenPages - Visibility Aspect: includeHiddenContent - $simUserGroup should be applied to the current object.
protected
applyPreviewSettings([FrontendBackendUserAuthentication $backendUser = null ]) : string|null
Parameters
- $backendUser : FrontendBackendUserAuthentication = null
Return values
string|null —null if no changes to the current frontend usergroups have been made, otherwise the original list of frontend usergroups
calculatePageCacheTimeout()
Calculates page cache timeout according to the records with starttime/endtime on the page.
protected
calculatePageCacheTimeout() : int
Return values
int —Page cache timeout or PHP_INT_MAX if cannot be determined
checkRootlineForIncludeSection()
Checks if visibility of the page is blocked upwards in the root line.
protected
checkRootlineForIncludeSection() : bool
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.
Tags
Return values
boolcheckTranslatedShortcut()
Checks whether a translated shortcut page has a different shortcut target than the original language page.
protected
checkTranslatedShortcut(int $languageId, ServerRequestInterface $request) : mixed
If that is the case, things get corrected to follow that alternative shortcut
Parameters
- $languageId : int
- $request : ServerRequestInterface
createHashBase()
Calculates the cache-hash (or the lock-hash) This hash is unique to the template, the variables ->id, ->type, list of frontend user groups, ->MP (Mount Points) and cHash array Used to get and later store the cached data.
protected
createHashBase([bool $createLockHashBase = false ]) : string
Parameters
- $createLockHashBase : bool = false
-
Whether to create the lock hash, which doesn't contain the "this->all" (the template information)
Return values
string —the serialized hash base
determineIdIsHiddenPage()
Checks if the page is hidden in the active workspace.
protected
determineIdIsHiddenPage() : bool
If it is hidden, preview flags will be set.
Return values
booldisableCache()
Disables caching of the current page.
protected
disableCache() : mixed
fetch_the_id()
Resolves the page id and sets up several related properties.
protected
fetch_the_id([ServerRequestInterface|null $request = null ]) : mixed
If $this->id is not set at all or is not a plain integer, the method does it's best to set the value to an integer. Resolving is based on this options:
- Splitting $this->id if it contains an additional type parameter.
- Finding the domain record start page
- First visible page
- Relocating the id below the domain record if outside
The following properties may be set up or updated:
- id
- requestedId
- type
- sys_page
- sys_page->where_groupAccess
- sys_page->where_hid_del
- Context: FrontendUser Aspect
- no_cache
- register['SYS_LASTCHANGED']
- pageNotFound
Via getPageAndRootlineWithDomain()
- rootLine
- page
- MP
- originalShortcutPage
- originalMountPointPage
- pageAccessFailureHistory['direct_access']
- pageNotFound
Parameters
- $request : ServerRequestInterface|null = null
Tags
getAdditionalHeaders()
Send additional headers from config.additionalHeaders
protected
getAdditionalHeaders() : array<string|int, mixed>
Return values
array<string|int, mixed>getBackendUser()
Returns the current BE user.
protected
getBackendUser() : FrontendBackendUserAuthentication|null
Return values
FrontendBackendUserAuthentication|nullgetCacheHeaders()
Get cache headers good for client/reverse proxy caching.
protected
getCacheHeaders() : array<string|int, mixed>
Return values
array<string|int, mixed>getCurrentPageCacheConfiguration()
Obtains a list of table/pid pairs to consider for page caching.
protected
getCurrentPageCacheConfiguration() : array<string|int, mixed>
TS configuration looks like this:
The cache lifetime of all pages takes starttime and endtime of news records of page 14 into account: config.cache.all = tt_news:14
The cache.lifetime of the current page allows to take records (e.g. fe_users) into account: config.cache.all = fe_users:current
The cache lifetime of page 42 takes starttime and endtime of news records of page 15 and addresses of page 16 into account: config.cache.42 = tt_news:15,tt_address:16
Tags
Return values
array<string|int, mixed> —Array of 'tablename:pid' pairs. There is at least a current page id in the array
getFirstTimeValueForRecord()
Find the minimum starttime or endtime value in the table and pid that is greater than the current time.
protected
getFirstTimeValueForRecord(string $tableDef, int $now) : int
Parameters
- $tableDef : string
-
Table definition (format tablename:pid)
- $now : int
-
"Now" time value
Tags
Return values
int —Value of the next start/stop time or PHP_INT_MAX if not found
getHash()
Calculates the cache-hash This hash is unique to the template, the variables ->id, ->type, list of fe user groups, ->MP (Mount Points) and cHash array Used to get and later store the cached data.
protected
getHash() : string
Tags
Return values
string —MD5 hash of serialized hash base from createHashBase(), prefixed with page id
getLockHash()
Calculates the lock-hash This hash is unique to the above hash, except that it doesn't contain the template information in $this->all.
protected
getLockHash() : string
Tags
Return values
string —MD5 hash prefixed with page id
getPageAndRootline()
Loads the page and root line records based on $this->id
protected
getPageAndRootline(ServerRequestInterface $request) : mixed
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 this properties:
Parameters
- $request : ServerRequestInterface
Tags
getPageAndRootlineWithDomain()
Gets ->page and ->rootline information based on ->id. ->id may change during this operation.
protected
getPageAndRootlineWithDomain(int $rootPageId, ServerRequestInterface $request) : mixed
If not inside a site, then default to first page in site.
Parameters
- $rootPageId : int
-
Page uid of the page where the found site is located
- $request : ServerRequestInterface
getRelevantParametersForCachingFromPageArguments()
Fetches the arguments that are relevant for creating the hash base from the given PageArguments object.
protected
getRelevantParametersForCachingFromPageArguments(PageArguments $pageArguments) : array<string|int, mixed>
Excluded parameters are not taken into account when calculating the hash base.
Parameters
- $pageArguments : PageArguments
Return values
array<string|int, mixed>getTimeTracker()
protected
getTimeTracker() : TimeTracker
Return values
TimeTrackergetUriToCurrentPageForRedirect()
Instantiate \TYPO3\CMS\Frontend\ContentObject to generate the correct target URL
protected
getUriToCurrentPageForRedirect(ServerRequestInterface $request) : string
Parameters
- $request : ServerRequestInterface
Return values
stringgetWebsiteTitle()
protected
getWebsiteTitle() : string
Return values
stringinitCaches()
Initializes the caching system.
protected
initCaches() : mixed
initializeSearchWordData()
Fills the sWordList property and builds the regular expression in TSFE that can be used to split strings by the submitted search words.
protected
initializeSearchWordData(mixed $searchWords) : mixed
Parameters
- $searchWords : mixed
-
- usually an array, but we can't be sure (yet)
Tags
initPageRenderer()
Initializes the page renderer object
protected
initPageRenderer() : mixed
isAllowedLinkVarValue()
Checks if the value defined in "config.linkVars" contains an allowed value.
protected
isAllowedLinkVarValue(string $haystack, string $needle) : bool
Otherwise, return FALSE which means the value will not be added to any links.
Parameters
- $haystack : string
-
The string in which to find $needle
- $needle : string
-
The string to find in $haystack
Return values
bool —Returns TRUE if $needle matches or is found in $haystack
isInPreviewMode()
protected
isInPreviewMode() : bool
Return values
boollogPageAccessFailure()
Log the page access failure with additional request information
protected
logPageAccessFailure(string $message, ServerRequestInterface $request) : void
Parameters
- $message : string
- $request : ServerRequestInterface
populatePageDataFromCache()
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.
protected
populatePageDataFromCache(array<string|int, mixed> $cachedData) : void
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.
Parameters
- $cachedData : array<string|int, mixed>
Tags
prepareDebugInformationForCachedPage()
protected
prepareDebugInformationForCachedPage(array<string|int, mixed> $cachedData) : void
Parameters
- $cachedData : array<string|int, mixed>
printTitle()
Compiles the content for the page <title> tag.
protected
printTitle(string $pageTitle[, bool $noTitle = false ][, bool $showTitleFirst = false ][, string $pageTitleSeparator = '' ]) : string
Parameters
- $pageTitle : string
-
The input title string, typically the "title" field of a page's record.
- $noTitle : bool = false
-
If set, then only the site title is outputted
- $showTitleFirst : bool = false
-
If set, then website title and $title is swapped
- $pageTitleSeparator : string = ''
-
an alternative to the ": " as the separator between site title and page title
Tags
Return values
string —The page title on the form "[website title]: [input-title]". Not htmlspecialchar()'ed.
processNonCacheableContentPartsAndSubstituteContentMarkers()
Processes the INTinclude-scripts and substitute in content.
protected
processNonCacheableContentPartsAndSubstituteContentMarkers(array<string|int, mixed> $nonCacheableData, ServerRequestInterface $request) : mixed
Takes $this->content, and splits the content by and then puts the content back together.
Parameters
- $nonCacheableData : array<string|int, mixed>
-
$GLOBALS['TSFE']->config['INTincScript'] or part of it
- $request : ServerRequestInterface
Tags
realPageCacheContent()
Set cache content to $this->content
protected
realPageCacheContent() : mixed
recursivelyReplaceIntPlaceholdersInContent()
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.
protected
recursivelyReplaceIntPlaceholdersInContent(ServerRequestInterface $request) : mixed
Parameters
- $request : ServerRequestInterface
releaseLock()
Release a page specific lock
protected
releaseLock(string $type) : mixed
Parameters
- $type : string
Tags
resolveContentPid()
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.
protected
resolveContentPid(ServerRequestInterface $request) : int
By using $TSFE->getPageAndRootline() on the cloned object, all rootline restrictions (extendToSubPages) are evaluated as well.
Parameters
- $request : ServerRequestInterface
Return values
int —the current page ID or another one if resolved properly - usually set to $this->contentPid
resolveTranslatedPageId()
If $this->id contains a translated page record, this needs to be resolved to the default language in order for all rootline functionality and access restrictions to be in place further on.
protected
resolveTranslatedPageId() : mixed
Additionally, if a translated page is found, LanguageAspect is set as well.
setAbsRefPrefix()
Converts relative paths in the HTML source to absolute paths for fileadmin/, typo3conf/ext/ and media/ folders.
protected
setAbsRefPrefix() : mixed
Tags
setOutputLanguage()
Sets all internal measures what language the page should be rendered.
protected
setOutputLanguage() : mixed
This is not for records, but rather the HTML / charset and the locallang labels
setPageArguments()
protected
setPageArguments(PageArguments $pageArguments) : void
Parameters
- $pageArguments : PageArguments
setPageCacheContent()
Sets cache content; Inserts the content string into the cache_pages cache.
protected
setPageCacheContent(string $content, mixed $data, int $expirationTstamp) : mixed
Parameters
- $content : string
-
The content to store in the HTML field of the cache table
- $data : mixed
-
The additional cache_data array, fx. $this->config
- $expirationTstamp : int
-
Expiration timestamp
Tags
setRegisterValueForSysLastChanged()
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.
protected
setRegisterValueForSysLastChanged(array<string|int, mixed> $page) : void
Parameters
- $page : array<string|int, mixed>
setSysLastChanged()
Sets sys last changed 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.
protected
setSysLastChanged() : mixed
Tags
settingLanguage()
Setting the language key that will be used by the current page.
protected
settingLanguage(ServerRequestInterface $request) : mixed
In this function it should be checked, 1) that this language exists, 2) that a page_overlay_record exists, .. and if not the default language, 0 (zero), should be set.
Parameters
- $request : ServerRequestInterface
splitLinkVarsString()
Split the link vars string by "," but not if the "," is inside of braces
protected
splitLinkVarsString(string $string) : array<string|int, mixed>
Parameters
- $string : string
Return values
array<string|int, mixed>unsetBackendUser()
protected
unsetBackendUser() : void
updateRootLinesWithTranslations()
Updating content of the two rootLines IF the language key is set!
protected
updateRootLinesWithTranslations() : mixed