TYPO3  7.6
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
TypoScriptFrontendController Class Reference

Public Member Functions

 __construct ($TYPO3_CONF_VARS, $id, $type, $no_cache= '', $cHash= '', $jumpurl= '', $MP= '', $RDCT= '')
 
 setContentType ($contentType)
 
 connectToDB ()
 
 sendRedirect ()
 
 getPageRenderer ()
 
 initFEuser ()
 
 initUserGroups ()
 
 isUserOrGroupSet ()
 
 checkAlternativeIdMethods ()
 
 clear_preview ()
 
 isBackendUserLoggedIn ()
 
 determineId ()
 
 fetch_the_id ()
 
 getPageAndRootline ()
 
 getPageShortcut ($SC, $mode, $thisUid, $itera=20, $pageLog=array(), $disableGroupCheck=false)
 
 checkRootlineForIncludeSection ()
 
 checkEnableFields ($row, $bypassGroupCheck=false)
 
 checkPageGroupAccess ($row, $groupList=null)
 
 checkPagerecordForIncludeSection ($row)
 
 checkIfLoginAllowedInBranch ()
 
 getPageAccessFailureReasons ()
 
 setIDfromArgV ()
 
 getPageAndRootlineWithDomain ($domainStartPage)
 
 setSysPageWhereClause ()
 
 findDomainRecord ($recursive=false)
 
 pageUnavailableAndExit ($reason= '', $header= '')
 
 pageNotFoundAndExit ($reason= '', $header= '')
 
 checkPageUnavailableHandler ()
 
 pageUnavailableHandler ($code, $header, $reason)
 
 pageNotFoundHandler ($code, $header= '', $reason= '')
 
 pageErrorHandler ($code, $header= '', $reason= '')
 
 checkAndSetAlias ()
 
 mergingWithGetVars ($GET_VARS)
 
 makeCacheHash ()
 
 reqCHash ()
 
 initTemplate ()
 
 getFromCache ()
 
 getFromCache_queryRow ()
 
 headerNoCache ()
 
 getHash ()
 
 getLockHash ()
 
 getConfigArray ()
 
 settingLanguage ()
 
 settingLocale ()
 
 handleDataSubmission ()
 
 setExternalJumpUrl ()
 
 jumpUrl ()
 
 redirectToExternalUrl ()
 
 setUrlIdToken ()
 
 calculateLinkVars ()
 
 checkPageForMountpointRedirect ()
 
 checkPageForShortcutRedirect ()
 
 isGeneratePage ()
 
 tempPageCacheContent ()
 
 realPageCacheContent ()
 
 setPageCacheContent ($content, $data, $expirationTstamp)
 
 clearPageCacheContent ()
 
 clearPageCacheContent_pidList ($pidList)
 
 setSysLastChanged ()
 
 acquirePageGenerationLock (&$lockObj, $key)
 
 releasePageGenerationLock (&$lockObj)
 
 releaseLocks ()
 
 addCacheTags (array $tags)
 
 generatePage_preProcessing ()
 
 generatePage_whichScript ()
 
 generatePage_postProcessing ()
 
 INTincScript_loadJSCode ()
 
 isINTincScript ()
 
 doXHTML_cleaning ()
 
 doLocalAnchorFix ()
 
 isOutputting ()
 
 processOutput ()
 
 sendCacheHeaders ()
 
 isStaticCacheble ()
 
 contentStrReplace ()
 
 storeSessionData ()
 
 setParseTime ()
 
 previewInfo ()
 
 hook_eofe ()
 
 beLoginLinkIPList ()
 
 addTempContentHttpHeaders ()
 
 encryptCharcode ($n, $start, $end, $offset)
 
 encryptEmail ($string, $back=false)
 
 checkFileInclude ($incFile)
 
 newCObj ()
 
 baseUrlWrap ($url)
 
 logDeprecatedTyposcript ($typoScriptProperty, $explanation= '')
 
 updateMD5paramsRecord ($hash)
 
 prefixLocalAnchorsWithScript ()
 
 doWorkspacePreview ()
 
 whichWorkspace ($returnTitle=false)
 
 includeLibraries (array $libraries)
 
 getStorageSiterootPids ()
 
 getPagesTSconfig ()
 
 setJS ($key, $content= '')
 
 setCSS ($key, $content)
 
 uniqueHash ($str= '')
 
 set_no_cache ($reason= '', $internal=false)
 
 set_cache_timeout_default ($seconds)
 
 getUniqueId ($desired= '')
 
 sL ($input)
 
 getLLL ($index, $LOCAL_LANG)
 
 csConv ($str, $from= '')
 
 convOutputCharset ($content)
 
 convPOSTCharset ()
 
 domainNameMatchesCurrentRequest ($domainName)
 
 getDomainDataForPid ($targetPid)
 
 getDomainNameForPid ($targetPid)
 
 getRequestedId ()
 

Public Attributes

 $id = ''
 
 $type = ''
 
 $cHash = ''
 
 $no_cache = false
 
 $rootLine = ''
 
 $page = ''
 
 $contentPid = 0
 
 $sys_page = ''
 
 $jumpurl = ''
 
 $pageNotFound = 0
 
 $domainStartPage = 0
 
 $pageAccessFailureHistory = array()
 
 $MP = ''
 
 $RDCT = ''
 
 $page_cache_reg1 = 0
 
 $siteScript = ''
 
 $fe_user = ''
 
 $loginUser = false
 
 $gr_list = ''
 
 $beUserLogin = false
 
 $workspacePreview = 0
 
 $loginAllowedInBranch = true
 
 $loginAllowedInBranch_mode = ''
 
 $ADMCMD_preview_BEUSER_uid = 0
 
 $fePreview = 0
 
 $showHiddenPage = false
 
 $showHiddenRecords = false
 
 $simUserGroup = 0
 
 $TYPO3_CONF_VARS = array()
 
 $config = ''
 
 $tmpl = null
 
 $cacheTimeOutDefault = false
 
 $cacheContentFlag = false
 
 $cacheExpires = 0
 
 $isClientCachable = false
 
 $all = array()
 
 $sPre = ''
 
 $pSetup = ''
 
 $newHash = ''
 
 $getMethodUrlIdToken = ''
 
 $no_cacheBeforePageGen = false
 
 $tempContent = false
 
 $forceTemplateParsing = false
 
 $cHash_array = array()
 
 $pagesTSconfig = ''
 
 $additionalHeaderData = array()
 
 $additionalFooterData = array()
 
 $additionalJavaScript = array()
 
 $additionalCSS = array()
 
 $JSeventFuncCalls
 
 $JSCode
 
 $inlineJS
 
 $divSection = ''
 
 $defaultBodyTag = '<body>'
 
 $debug = ''
 
 $intTarget = ''
 
 $extTarget = ''
 
 $fileTarget = ''
 
 $MP_defaults = array()
 
 $spamProtectEmailAddresses = 0
 
 $absRefPrefix = ''
 
 $compensateFieldWidth = ''
 
 $lockFilePath = ''
 
 $ATagParams = ''
 
 $sWordRegEx = ''
 
 $sWordList = ''
 
 $linkVars = ''
 
 $excludeCHashVars = ''
 
 $displayEditIcons = ''
 
 $displayFieldEditIcons = ''
 
 $sys_language_uid = 0
 
 $sys_language_mode = ''
 
 $sys_language_content = 0
 
 $sys_language_contentOL = 0
 
 $sys_language_isocode = ''
 
 $applicationData = array()
 
 $register = array()
 
 $registerStack = array()
 
 $cObjectDepthCounter = 50
 
 $recordRegister = array()
 
 $currentRecord = ''
 
 $accessKey = array()
 
 $imagesOnPage = array()
 
 $lastImageInfo = array()
 
 $uniqueCounter = 0
 
 $uniqueString = ''
 
 $indexedDocTitle = ''
 
 $altPageTitle = ''
 
 $baseUrl = ''
 
 $anchorPrefix = ''
 
 $cObj = ''
 
 $content = ''
 
 $clientInfo = ''
 
 $scriptParseTime = 0
 
 $csConvObj
 
 $defaultCharSet = 'utf-8'
 
 $renderCharset = 'utf-8'
 
 $metaCharset = 'utf-8'
 
 $localeCharset = ''
 
 $lang = ''
 
 $LL_labels_cache = array()
 
 $LL_files_cache = array()
 
 $xhtmlDoctype = ''
 
 $xhtmlVersion
 
 $dtdAllowsFrames
 

Protected Member Functions

 initPageRenderer ()
 
 initCaches ()
 
 determineIdIsHiddenPage ()
 
 createHashBase ($createLockHashBase=false)
 
 updateRootLinesWithTranslations ()
 
 checkTranslatedShortcut ()
 
 regeneratePageTitle ()
 
 recursivelyReplaceIntPlaceholdersInContent ()
 
 INTincScript_includeLibs ($INTiS_config)
 
 INTincScript_process ($INTiS_config)
 
 disableCache ()
 
 calculatePageCacheTimeout ()
 
 getCurrentPageCacheConfiguration ()
 
 getFirstTimeValueForRecord ($tableDef, $now)
 
 acquireLock ($type, $key)
 
 releaseLock ($type)
 
 getBackendUser ()
 
 getDatabaseConnection ()
 
 getTimeTracker ()
 
 getDocumentTemplate ()
 

Protected Attributes

 $originalMountPointPage = null
 
 $originalShortcutPage = null
 
 $activeUrlHandlers = []
 
 $languageDependencies = array()
 
 $locks = []
 
 $pageRenderer = null
 
 $pageCache
 
 $pageCacheTags = array()
 
 $cacheHash
 
 $domainDataCache = array()
 
 $contentType = 'text/html'
 
 $requestedId
 

Private Attributes

 $usedUniqueIds = array()
 

Detailed Description

Class for the built TypoScript based frontend. Instantiated in index_ts.php script as the global object TSFE.

Main frontend class, instantiated in the index_ts.php script as the global object TSFE.

This class has a lot of functions and internal variable which are used from index_ts.php.

The class is instantiated as $GLOBALS['TSFE'] in index_ts.php.

The use of this class should be inspired by the order of function calls as found in index_ts.php.

Definition at line 64 of file TypoScriptFrontendController.php.

Constructor & Destructor Documentation

__construct (   $TYPO3_CONF_VARS,
  $id,
  $type,
  $no_cache = '',
  $cHash = '',
  $jumpurl = '',
  $MP = '',
  $RDCT = '' 
)

Class constructor Takes a number of GET/POST input variable as arguments and stores them internally. The processing of these variables goes on later in this class. Also sets internal clientInfo array (browser information) and a unique string (->uniqueString) for this script instance; A md5 hash of the microtime()

Parameters
array$TYPO3_CONF_VARSThe global $TYPO3_CONF_VARS array. Will be set internally in ->TYPO3_CONF_VARS
mixed$idThe value of GeneralUtility::_GP('id')
int$typeThe value of GeneralUtility::_GP('type')
bool | string$no_cacheThe value of GeneralUtility::_GP('no_cache'), evaluated to 1/0
string$cHashThe value of GeneralUtility::_GP('cHash')
string$jumpurlThe value of GeneralUtility::_GP('jumpurl'), unused since TYPO3 CMS 7. Will have no effect in TYPO3 CMS 8 anymore
string$MPThe value of GeneralUtility::_GP('MP')
string$RDCTThe value of GeneralUtility::_GP('RDCT')
See Also
index_ts.php

Definition at line 902 of file TypoScriptFrontendController.php.

References TypoScriptFrontendController\$cHash, TypoScriptFrontendController\$id, TypoScriptFrontendController\$jumpurl, TypoScriptFrontendController\$MP, TypoScriptFrontendController\$no_cache, TypoScriptFrontendController\$RDCT, TypoScriptFrontendController\$type, TypoScriptFrontendController\$TYPO3_CONF_VARS, GeneralUtility\callUserFunction(), GeneralUtility\clientInfo(), TypoScriptFrontendController\disableCache(), GeneralUtility\getIndpEnv(), TypoScriptFrontendController\getTimeTracker(), TypoScriptFrontendController\initCaches(), TypoScriptFrontendController\initPageRenderer(), GeneralUtility\makeInstance(), and GeneralUtility\SYSLOG_SEVERITY_WARNING.

Member Function Documentation

acquireLock (   $type,
  $key 
)
protected

Acquire a page specific lock

Parameters
string$type
string$key
Exceptions
\InvalidArgumentException
\RuntimeException
\TYPO3\CMS\Core\Cache\Exception\NoSuchCacheException

Definition at line 4909 of file TypoScriptFrontendController.php.

References TypoScriptFrontendController\$type, LockingStrategyInterface\LOCK_CAPABILITY_EXCLUSIVE, LockingStrategyInterface\LOCK_CAPABILITY_NOBLOCK, and GeneralUtility\makeInstance().

Referenced by TypoScriptFrontendController\getFromCache().

acquirePageGenerationLock ( $lockObj,
  $key 
)

Lock the page generation process The lock is used to queue page requests until this page is successfully stored in the cache.

Parameters
Locker$lockObjReference to a locking object
string$keyString to identify the lock in the system
Returns
bool Returns TRUE if the lock could be obtained, FALSE otherwise (= process had to wait for existing lock to be released)
See Also
releasePageGenerationLock()
Deprecated:
since TYPO3 CMS 7, will be removed with TYPO3 CMS 8

Definition at line 3268 of file TypoScriptFrontendController.php.

References TypoScriptFrontendController\headerNoCache(), GeneralUtility\logDeprecatedFunction(), GeneralUtility\makeInstance(), GeneralUtility\SYSLOG_SEVERITY_ERROR, and GeneralUtility\SYSLOG_SEVERITY_INFO.

addCacheTags ( array  $tags)

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

Parameters
array$tagsAn array of tag
Returns
void

Definition at line 3339 of file TypoScriptFrontendController.php.

addTempContentHttpHeaders ( )

Sends HTTP headers for temporary content. These headers prevent search engines from caching temporary content and asks them to revisit this page again.

Returns
void

Definition at line 3952 of file TypoScriptFrontendController.php.

Referenced by TypoScriptFrontendController\processOutput().

baseUrlWrap (   $url)

Prefixing the input URL with ->baseUrl If ->baseUrl is set and the input url is not absolute in some way. 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
string$urlInput URL, relative or absolute
Returns
string Processed input value.

Definition at line 4105 of file TypoScriptFrontendController.php.

References $url.

beLoginLinkIPList ( )

Returns a link to the BE login screen with redirect to the front-end

Returns
string HTML, a tag for a link to the backend.

Definition at line 3929 of file TypoScriptFrontendController.php.

References GeneralUtility\cmpIP(), and GeneralUtility\getIndpEnv().

calculateLinkVars ( )

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

Returns
void

Definition at line 2980 of file TypoScriptFrontendController.php.

References TypoScriptFrontendController\$linkVars, GeneralUtility\_GET(), GeneralUtility\implodeArrayForUrl(), PageGenerator\isAllowedLinkVarValue(), and GeneralUtility\trimExplode().

calculatePageCacheTimeout ( )
protected

Calculates page cache timeout according to the records with starttime/endtime on the page.

Returns
int Page cache timeout or PHP_INT_MAX if cannot be determined

Definition at line 4670 of file TypoScriptFrontendController.php.

References $GLOBALS, TypoScriptFrontendController\getCurrentPageCacheConfiguration(), and TypoScriptFrontendController\getFirstTimeValueForRecord().

checkAlternativeIdMethods ( )

Provides ways to bypass the '?id=[xxx]&type=[xx]' format, using either PATH_INFO or virtual HTML-documents (using Apache mod_rewrite)

Two options: 1) Use PATH_INFO (also Apache) to extract id and type from that var. Does not require any special modules compiled with apache. (less typical) 2) Using hook which enables features like those provided from "realurl" extension (AKA "Speaking URLs")

Returns
void

Definition at line 1170 of file TypoScriptFrontendController.php.

References GeneralUtility\callUserFunction(), and GeneralUtility\getIndpEnv().

checkAndSetAlias ( )

Fetches the integer page id for a page alias. Looks if ->id is not an integer and if so it will search for a page alias and if found the page uid of that page is stored in $this->id

Returns
void private

Definition at line 2209 of file TypoScriptFrontendController.php.

References MathUtility\canBeInterpretedAsInteger().

Referenced by TypoScriptFrontendController\fetch_the_id().

checkEnableFields (   $row,
  $bypassGroupCheck = false 
)

Checks page record for enableFields Returns TRUE if enableFields does not disable the page record. Takes notice of the ->showHiddenPage flag and uses SIM_ACCESS_TIME for start/endtime evaluation

Parameters
array$rowThe page record to evaluate (needs fields: hidden, starttime, endtime, fe_group)
bool$bypassGroupCheckBypass group-check
Returns
bool TRUE, if record is viewable.
See Also
TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer::getTreeList(), checkPagerecordForIncludeSection()

Definition at line 1791 of file TypoScriptFrontendController.php.

References $GLOBALS, GeneralUtility\callUserFunction(), and TypoScriptFrontendController\checkPageGroupAccess().

Referenced by TypoScriptFrontendController\checkPagerecordForIncludeSection().

checkFileInclude (   $incFile)

Checks if a PHPfile may be included.

Parameters
string$incFileRelative path to php file
Returns
bool Returns TRUE if $GLOBALS['TYPO3_CONF_VARS']['FE']['noPHPscriptInclude'] is not set OR if the file requested for inclusion is found in one of the allowed paths.
Deprecated:
since TYPO3 CMS 7, will be removed with TYPO3 CMS 8

Definition at line 4032 of file TypoScriptFrontendController.php.

References GeneralUtility\logDeprecatedFunction().

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!)

Returns
bool returns TRUE if logins are OK, otherwise FALSE (and then the login user must be unset!)

Definition at line 1847 of file TypoScriptFrontendController.php.

References elseif.

Referenced by TypoScriptFrontendController\determineId().

checkPageForMountpointRedirect ( )

Redirect to 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.

Returns
void

Definition at line 3023 of file TypoScriptFrontendController.php.

References PageRepository\DOKTYPE_MOUNTPOINT.

checkPageForShortcutRedirect ( )

Redirect to target page, if the current page is a Shortcut.

If the current page is of type shortcut and accessed directly via its URL, this function redirects to the Shortcut target using a Location header.

Returns
void If page is not a Shortcut, redirects and exits otherwise

Definition at line 3038 of file TypoScriptFrontendController.php.

References PageRepository\DOKTYPE_SHORTCUT.

checkPageGroupAccess (   $row,
  $groupList = null 
)

Check group access against a page record

Parameters
array$rowThe page record to evaluate (needs field: fe_group)
mixed$groupListList of group id's (comma list or array). Default is $this->gr_list
Returns
bool TRUE, if group access is granted. private

Definition at line 1817 of file TypoScriptFrontendController.php.

References TypoScriptFrontendController\$gr_list.

Referenced by TypoScriptFrontendController\checkEnableFields(), and TypoScriptFrontendController\getPageAccessFailureReasons().

checkPagerecordForIncludeSection (   $row)

Checks page record for include section

Parameters
array$rowThe page record to evaluate (needs fields: extendToSubpages + hidden, starttime, endtime, fe_group)
Returns
bool Returns TRUE if either extendToSubpages is not checked or if the enableFields does not disable the page record. private
See Also
checkEnableFields(), TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer::getTreeList(), checkRootlineForIncludeSection()

Definition at line 1837 of file TypoScriptFrontendController.php.

References TypoScriptFrontendController\checkEnableFields().

Referenced by TypoScriptFrontendController\checkRootlineForIncludeSection().

checkPageUnavailableHandler ( )

Checks whether the pageUnavailableHandler should be used. To be used, pageUnavailable_handling must be set and devIPMask must not match the current visitor's IP address.

Returns
bool TRUE/FALSE whether the pageUnavailable_handler should be used.

Definition at line 2022 of file TypoScriptFrontendController.php.

References GeneralUtility\cmpIP(), and GeneralUtility\getIndpEnv().

Referenced by TypoScriptFrontendController\connectToDB(), TypoScriptFrontendController\fetch_the_id(), TypoScriptFrontendController\getConfigArray(), and TypoScriptFrontendController\getPageAndRootline().

checkRootlineForIncludeSection ( )
checkTranslatedShortcut ( )
protected

Checks whether a translated shortcut page has a different shortcut target than the original language page. If that is the case, things get corrected to follow that alternative shortcut

Returns
void

Definition at line 2841 of file TypoScriptFrontendController.php.

References TypoScriptFrontendController\fetch_the_id(), and TypoScriptFrontendController\getPageShortcut().

Referenced by TypoScriptFrontendController\settingLanguage().

clear_preview ( )

Clears the preview-flags, sets sim_exec_time to current time. 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.

Returns
void

Definition at line 1189 of file TypoScriptFrontendController.php.

References $GLOBALS.

Referenced by TypoScriptFrontendController\determineId().

clearPageCacheContent ( )

Clears cache content (for $this->newHash)

Returns
void

Definition at line 3224 of file TypoScriptFrontendController.php.

Referenced by TypoScriptFrontendController\generatePage_postProcessing(), and TypoScriptFrontendController\reqCHash().

clearPageCacheContent_pidList (   $pidList)

Clears cache content for a list of page ids

Parameters
string$pidListA list of INTEGER numbers which points to page uids for which to clear entries in the cache_pages cache (page content cache)
Returns
void

Definition at line 3235 of file TypoScriptFrontendController.php.

References GeneralUtility\trimExplode().

connectToDB ( )

Connect to SQL database. May exit after outputting an error message or some JavaScript redirecting to the install tool.

Exceptions
\RuntimeException
ServiceUnavailableException
Returns
void

Definition at line 967 of file TypoScriptFrontendController.php.

References GeneralUtility\callUserFunction(), TypoScriptFrontendController\checkPageUnavailableHandler(), TypoScriptFrontendController\getDatabaseConnection(), TypoScriptFrontendController\pageUnavailableAndExit(), and GeneralUtility\SYSLOG_SEVERITY_ERROR.

contentStrReplace ( )

Substitute various tokens in content. This should happen only if the content is not cached by proxies or client browsers.

Returns
void

Definition at line 3822 of file TypoScriptFrontendController.php.

References TypoScriptFrontendController\$getMethodUrlIdToken, and GeneralUtility\callUserFunction().

Referenced by TypoScriptFrontendController\processOutput().

convOutputCharset (   $content)

Converts input string from renderCharset to metaCharset IF the two charsets are different.

Parameters
string$contentContent to be converted.
Returns
string Converted content string.

Definition at line 4644 of file TypoScriptFrontendController.php.

References TypoScriptFrontendController\$content.

Referenced by TypoScriptFrontendController\generatePage_postProcessing(), and TypoScriptFrontendController\INTincScript_process().

convPOSTCharset ( )

Converts the $_POST array from metaCharset (page HTML charset from input form) to renderCharset (internal processing) IF the two charsets are different.

Returns
void

Definition at line 4657 of file TypoScriptFrontendController.php.

References $GLOBALS.

createHashBase (   $createLockHashBase = false)
protected

Calculates the cache-hash (or the lock-hash) This hash is unique to the template, the variables ->id, ->type, ->gr_list (list of groups), ->MP (Mount Points) and cHash array Used to get and later store the cached data.

Parameters
bool$createLockHashBaseWhether to create the lock hash, which doesn't contain the "this->all" (the template information)
Returns
string the serialized hash base

Definition at line 2536 of file TypoScriptFrontendController.php.

References TypoScriptFrontendController\$all, and GeneralUtility\callUserFunction().

Referenced by TypoScriptFrontendController\getHash(), and TypoScriptFrontendController\getLockHash().

csConv (   $str,
  $from = '' 
)

Converts the charset of the input string if applicable. The "to" charset is determined by the currently used charset for the page which is "utf-8" by default or set by $GLOBALS['TSFE']->config['config']['renderCharset'] Only if there is a difference between the two charsets will a conversion be made The conversion is done real-time - no caching for performance at this point!

Parameters
string$strString to convert charset for
string$fromOptional "from" charset.
Returns
string Output string, converted if needed.
See Also
CharsetConverter

Definition at line 4628 of file TypoScriptFrontendController.php.

References TypoScriptFrontendController\$renderCharset.

determineId ( )
determineIdIsHiddenPage ( )
protected
disableCache ( )
protected
doLocalAnchorFix ( )

Returns the mode of Local Anchor prefixing

Returns
string Keyword: "all", "cached" or "output
Deprecated:
The TypoScript option "config.prefixLocalAnchors" and the according method in TSFE have been deprecated with TYPO3 CMS 7 and will be removed with TYPO3 CMS 8.

Definition at line 3648 of file TypoScriptFrontendController.php.

References GeneralUtility\logDeprecatedFunction().

domainNameMatchesCurrentRequest (   $domainName)

Whether the given domain name (potentially including a path segment) matches currently requested host or the host including the path segment

Parameters
string$domainName
Returns
bool

Definition at line 4838 of file TypoScriptFrontendController.php.

References GeneralUtility\getIndpEnv().

doWorkspacePreview ( )

Returns TRUE if workspace preview is enabled

Returns
bool Returns TRUE if workspace preview is enabled

Definition at line 4182 of file TypoScriptFrontendController.php.

Referenced by TypoScriptFrontendController\determineId(), TypoScriptFrontendController\processOutput(), TypoScriptFrontendController\sendCacheHeaders(), and TypoScriptFrontendController\whichWorkspace().

doXHTML_cleaning ( )

Returns the mode of XHTML cleaning

Returns
string Keyword: "all", "cached" or "output
Deprecated:
since TYPO3 CMS 7, will be removed in TYPO3 CMS 8; The TypoScript option "config.xhtml_cleaning" has been deprecated

Definition at line 3636 of file TypoScriptFrontendController.php.

References GeneralUtility\logDeprecatedFunction().

encryptCharcode (   $n,
  $start,
  $end,
  $offset 
)

Encryption (or decryption) of a single character. Within the given range the character is shifted with the supplied offset.

Parameters
int$nOrdinal of input character
int$startStart of range
int$endEnd of range
int$offsetOffset
Returns
string encoded/decoded version of character

Definition at line 3976 of file TypoScriptFrontendController.php.

References elseif.

Referenced by TypoScriptFrontendController\encryptEmail().

encryptEmail (   $string,
  $back = false 
)

Encryption of email addresses for -tags See the spam protection setup in TS 'config.'

Parameters
string$stringInput string to en/decode: "blabl.nosp@m.a@bl.nosp@m.a.com
bool$backIf set, the process is reversed, effectively decoding, not encoding.
Returns
string encoded/decoded version of $string

Definition at line 3994 of file TypoScriptFrontendController.php.

References elseif, and TypoScriptFrontendController\encryptCharcode().

fetch_the_id ( )
findDomainRecord (   $recursive = false)

Looking up a domain record based on HTTP_HOST

Parameters
bool$recursiveIf set, it looks "recursively" meaning that a domain like "123.456.typo3.com" would find a domain record like "typo3.com" if "123.456.typo3.com" or "456.typo3.com" did not exist.
Returns
int Returns the page id of the page where the domain record was found. private

Definition at line 1969 of file TypoScriptFrontendController.php.

References GeneralUtility\getIndpEnv().

Referenced by TypoScriptFrontendController\fetch_the_id().

generatePage_postProcessing ( )

Does some processing AFTER the pagegen script is included. This includes calling XHTML cleaning (if configured), caching the page, indexing the page (if configured) and setting sysLastChanged

Returns
void

Definition at line 3397 of file TypoScriptFrontendController.php.

References GeneralUtility\callUserFunction(), TypoScriptFrontendController\clearPageCacheContent(), TypoScriptFrontendController\convOutputCharset(), elseif, GeneralUtility\getUserObj(), TypoScriptFrontendController\realPageCacheContent(), TypoScriptFrontendController\set_no_cache(), and TypoScriptFrontendController\setSysLastChanged().

generatePage_preProcessing ( )
generatePage_whichScript ( )

Determines to include custom or pagegen.php script returns script-filename if a TypoScript (config) script is defined and should be included instead of pagegen.php

Returns
string|NULL The relative filepath of "config.pageGenScript" if found and allowed

Definition at line 3383 of file TypoScriptFrontendController.php.

getBackendUser ( )
protected
getConfigArray ( )
getCurrentPageCacheConfiguration ( )
protected

Obtains a list of table/pid pairs to consider for page caching.

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

Returns
array Array of 'tablename:pid' pairs. There is at least a current page id in the array
See Also
TypoScriptFrontendController::calculatePageCacheTimeout()

Definition at line 4702 of file TypoScriptFrontendController.php.

References GeneralUtility\trimExplode().

Referenced by TypoScriptFrontendController\calculatePageCacheTimeout().

getDatabaseConnection ( )
protected
getDocumentTemplate ( )
protected

Returns an instance of DocumentTemplate

Returns

Definition at line 5004 of file TypoScriptFrontendController.php.

References $GLOBALS.

getDomainDataForPid (   $targetPid)

Obtains domain data for the target pid. Domain data is an array with 'pid', 'domainName' and 'forced' members (see sys_domain table for meaning of these fields.

Parameters
int$targetPidTarget page id
Returns
mixed Return domain data or NULL

Definition at line 4853 of file TypoScriptFrontendController.php.

Referenced by TypoScriptFrontendController\getDomainNameForPid().

getDomainNameForPid (   $targetPid)

Obtains the domain name for the target pid. If there are several domains, the first is returned.

Parameters
int$targetPidTarget page id
Returns
mixed Return domain name or NULL if not found

Definition at line 4883 of file TypoScriptFrontendController.php.

References TypoScriptFrontendController\getDomainDataForPid().

getFirstTimeValueForRecord (   $tableDef,
  $now 
)
protected

Find the minimum starttime or endtime value in the table and pid that is greater than the current time.

Parameters
string$tableDefTable definition (format tablename:pid)
int$now"Now" time value
Exceptions
\InvalidArgumentException
Returns
int Value of the next start/stop time or PHP_INT_MAX if not found
See Also
TypoScriptFrontendController::calculatePageCacheTimeout()

Definition at line 4723 of file TypoScriptFrontendController.php.

References $GLOBALS, and GeneralUtility\trimExplode().

Referenced by TypoScriptFrontendController\calculatePageCacheTimeout().

getFromCache ( )
getFromCache_queryRow ( )

Returning the cached version of page with hash = newHash

Returns
array Cached row, if any. Otherwise void.

Definition at line 2465 of file TypoScriptFrontendController.php.

References TypoScriptFrontendController\getTimeTracker().

Referenced by TypoScriptFrontendController\getFromCache(), and TypoScriptFrontendController\tempPageCacheContent().

getHash ( )

Calculates the cache-hash This hash is unique to the template, the variables ->id, ->type, ->gr_list (list of groups), ->MP (Mount Points) and cHash array Used to get and later store the cached data.

Returns
string MD5 hash of serialized hash base from createHashBase() private
See Also
getFromCache(), getLockHash()

Definition at line 2507 of file TypoScriptFrontendController.php.

References TypoScriptFrontendController\createHashBase().

Referenced by TypoScriptFrontendController\generatePage_preProcessing(), and TypoScriptFrontendController\getFromCache().

getLLL (   $index,
  $LOCAL_LANG 
)

Returns 'locallang' label - may need initializing by initLLvars

Parameters
string$indexLocal_lang key for which to return label (language is determined by $this->lang)
array$LOCAL_LANGThe locallang array in which to search
Returns
string Label value of $index key.

Definition at line 4574 of file TypoScriptFrontendController.php.

References TypoScriptFrontendController\$lang, and elseif.

Referenced by TypoScriptFrontendController\sL().

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.

Returns
string MD5 hash private
See Also
getFromCache(), getHash()

Definition at line 2520 of file TypoScriptFrontendController.php.

References TypoScriptFrontendController\createHashBase().

Referenced by TypoScriptFrontendController\getFromCache().

getPageAccessFailureReasons ( )

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

Returns
array Summary of why page access was not allowed.

Definition at line 1876 of file TypoScriptFrontendController.php.

References $GLOBALS, and TypoScriptFrontendController\checkPageGroupAccess().

Referenced by TypoScriptFrontendController\pageErrorHandler().

getPageAndRootline ( )

Gets the page and rootline arrays based on the id, $this->id

If the id does not correspond to a proper page, the 'previous' valid page in the rootline is found If the page is a shortcut (doktype=4), the ->id is loaded with that id

Whether or not the ->id is changed to the shortcut id or the previous id in rootline (eg if a page is hidden), the ->page-array and ->rootline is found and must also be valid.

Sets or manipulates internal variables such as: $this->id, $this->page, $this->rootLine, $this->MP, $this->pageNotFound

Exceptions
ServiceUnavailableException
PageNotFoundException
Returns
void private

Definition at line 1558 of file TypoScriptFrontendController.php.

References TypoScriptFrontendController\$page, TypoScriptFrontendController\checkPageUnavailableHandler(), TypoScriptFrontendController\checkRootlineForIncludeSection(), PageRepository\DOKTYPE_MOUNTPOINT, PageRepository\DOKTYPE_SHORTCUT, PageRepository\DOKTYPE_SPACER, TypoScriptFrontendController\getPageShortcut(), TypoScriptFrontendController\pageNotFoundAndExit(), TypoScriptFrontendController\pageUnavailableAndExit(), GeneralUtility\SYSLOG_SEVERITY_ERROR, and TypoScriptFrontendController\whichWorkspace().

Referenced by TypoScriptFrontendController\getPageAndRootlineWithDomain().

getPageAndRootlineWithDomain (   $domainStartPage)

Gets ->page and ->rootline information based on ->id. ->id may change during this operation. If not inside domain, then default to first page in domain.

Parameters
int$domainStartPagePage uid of the page where the found domain record is (pid of the domain record)
Returns
void private

Definition at line 1928 of file TypoScriptFrontendController.php.

References TypoScriptFrontendController\$domainStartPage, and TypoScriptFrontendController\getPageAndRootline().

Referenced by TypoScriptFrontendController\fetch_the_id().

getPageRenderer ( )

Gets instance of PageRenderer

Returns
PageRenderer
Deprecated:
since TYPO3 CMS 7, will be removed in TYPO3 CMS 8.

Definition at line 1033 of file TypoScriptFrontendController.php.

References TypoScriptFrontendController\$pageRenderer, TypoScriptFrontendController\initPageRenderer(), and GeneralUtility\logDeprecatedFunction().

getPageShortcut (   $SC,
  $mode,
  $thisUid,
  $itera = 20,
  $pageLog = array(),
  $disableGroupCheck = false 
)

Get page shortcut; Finds the records pointed to by input value $SC (the shortcut value)

Parameters
int$SCThe value of the "shortcut" field from the pages record
int$modeThe shortcut mode: 1 will select first subpage, 2 a random subpage, 3 the parent page; default is the page pointed to by $SC
int$thisUidThe current page UID of the page which is a shortcut
int$iteraSafety feature which makes sure that the function is calling itself recursively max 20 times (since this function can find shortcuts to other shortcuts to other shortcuts...)
array$pageLogAn array filled with previous page uids tested by the function - new page uids are evaluated against this to avoid going in circles.
bool$disableGroupCheckIf true, the group check is disabled when fetching the target page (needed e.g. for menu generation)
Exceptions
\RuntimeException
PageNotFoundException
Returns
mixed Returns the page record of the page that the shortcut pointed to. private
See Also
getPageAndRootline()

Definition at line 1683 of file TypoScriptFrontendController.php.

References TypoScriptFrontendController\$page, PageRepository\DOKTYPE_BE_USER_SECTION, PageRepository\DOKTYPE_SHORTCUT, GeneralUtility\intExplode(), PageRepository\SHORTCUT_MODE_FIRST_SUBPAGE, PageRepository\SHORTCUT_MODE_PARENT_PAGE, PageRepository\SHORTCUT_MODE_RANDOM_SUBPAGE, and GeneralUtility\SYSLOG_SEVERITY_ERROR.

Referenced by TypoScriptFrontendController\checkTranslatedShortcut(), and TypoScriptFrontendController\getPageAndRootline().

getPagesTSconfig ( )

Returns the pages TSconfig array based on the currect ->rootLine

Returns
array

Definition at line 4269 of file TypoScriptFrontendController.php.

References TypoScriptFrontendController\$pagesTSconfig, TypoScriptParser\checkIncludeLines_array(), and GeneralUtility\makeInstance().

getRequestedId ( )

Fetches the originally requested id, fallsback to $this->id

Returns
int the originally requested page uid
See Also
fetch_the_id()

Definition at line 4895 of file TypoScriptFrontendController.php.

References TypoScriptFrontendController\$id.

getStorageSiterootPids ( )

Traverses the ->rootLine and returns an array with the first occurrance of storage pid and siteroot pid

Returns
array Array with keys '_STORAGE_PID' and '_SITEROOT' set to the first occurrences found.
Deprecated:
since TYPO3 CMS 7, will be removed with TYPO3 CMS 8. The usage of "storage_pid" is discouraged, the option for "is_siteroot" is handled via the RootlineUtility directly.

Definition at line 4246 of file TypoScriptFrontendController.php.

References GeneralUtility\logDeprecatedFunction().

getTimeTracker ( )
protected
getUniqueId (   $desired = '')

Returns a unique id to be used as a XML ID (in HTML / XHTML mode)

Parameters
string$desiredThe desired id. If already used it is suffixed with a number
Returns
string The unique id

Definition at line 4478 of file TypoScriptFrontendController.php.

References TypoScriptFrontendController\uniqueHash().

handleDataSubmission ( )

Handle data submission This is done at this point, because we need the config values

Returns
void

Definition at line 2864 of file TypoScriptFrontendController.php.

References GeneralUtility\getUserObj().

headerNoCache ( )

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.

Returns
bool If shift-reload in client browser has been clicked, disable getting cached page (and regenerate it).

Definition at line 2480 of file TypoScriptFrontendController.php.

References GeneralUtility\callUserFunction().

Referenced by TypoScriptFrontendController\acquirePageGenerationLock(), TypoScriptFrontendController\getFromCache(), TypoScriptFrontendController\releasePageGenerationLock(), and TypoScriptFrontendController\tempPageCacheContent().

hook_eofe ( )

End-Of-Frontend hook

Returns
void

Definition at line 3913 of file TypoScriptFrontendController.php.

References GeneralUtility\callUserFunction().

includeLibraries ( array  $libraries)

Includes a comma-separated list of library files by PHP function include_once.

Parameters
array$librariesThe libraries to be included.
Returns
void
Todo:
deprecate this method

Definition at line 4219 of file TypoScriptFrontendController.php.

References TypoScriptFrontendController\getTimeTracker().

Referenced by TypoScriptFrontendController\INTincScript_includeLibs().

initCaches ( )
protected

Initializes the caching system.

Returns
void

Definition at line 1051 of file TypoScriptFrontendController.php.

References GeneralUtility\makeInstance().

Referenced by TypoScriptFrontendController\__construct().

initFEuser ( )
initPageRenderer ( )
protected

Initializes the page renderer object

Definition at line 940 of file TypoScriptFrontendController.php.

References GeneralUtility\makeInstance().

Referenced by TypoScriptFrontendController\__construct(), and TypoScriptFrontendController\getPageRenderer().

initTemplate ( )

Initialize the TypoScript template parser

Returns
void

Definition at line 2326 of file TypoScriptFrontendController.php.

References GeneralUtility\makeInstance().

initUserGroups ( )

Initializes the front-end user groups. Sets ->loginUser and ->gr_list based on front-end user status.

Returns
void

Definition at line 1114 of file TypoScriptFrontendController.php.

References TypoScriptFrontendController\$showHiddenRecords, and GeneralUtility\devLog().

Referenced by TypoScriptFrontendController\fetch_the_id().

INTincScript_includeLibs (   $INTiS_config)
protected

Include libraries for uncached objects.

Parameters
array$INTiS_config$GLOBALS['TSFE']->config['INTincScript'] or part of it
Returns
void
See Also
INTincScript()

Definition at line 3526 of file TypoScriptFrontendController.php.

References TypoScriptFrontendController\includeLibraries(), and GeneralUtility\trimExplode().

Referenced by TypoScriptFrontendController\recursivelyReplaceIntPlaceholdersInContent().

INTincScript_loadJSCode ( )

Loads the JavaScript code for INTincScript

Returns
void

Definition at line 3590 of file TypoScriptFrontendController.php.

References TypoScriptFrontendController\$additionalCSS, and TypoScriptFrontendController\$additionalJavaScript.

INTincScript_process (   $INTiS_config)
protected

Processes the INTinclude-scripts and substitue in content.

Parameters
array$INTiS_config$GLOBALS['TSFE']->config['INTincScript'] or part of it
Returns
void
See Also
INTincScript()

Definition at line 3543 of file TypoScriptFrontendController.php.

References TypoScriptFrontendController\convOutputCharset(), and TypoScriptFrontendController\getTimeTracker().

Referenced by TypoScriptFrontendController\recursivelyReplaceIntPlaceholdersInContent().

isBackendUserLoggedIn ( )

Checks if a backend user is logged in

Returns
bool whether a backend user is logged in

Definition at line 1203 of file TypoScriptFrontendController.php.

References TypoScriptFrontendController\$beUserLogin.

isGeneratePage ( )

Returns TRUE if the page should be generated. That is if no URL handler is active and the cacheContentFlag is not set.

Returns
bool

Definition at line 3082 of file TypoScriptFrontendController.php.

isINTincScript ( )

Determines if there are any INTincScripts to include.

Returns
bool Returns TRUE if scripts are found and no URL handler is active.

Definition at line 3625 of file TypoScriptFrontendController.php.

Referenced by TypoScriptFrontendController\isStaticCacheble(), and TypoScriptFrontendController\sendCacheHeaders().

isOutputting ( )

Determines if content should be outputted. Outputting content is done only if no URL handler is active and no hook disables the output.

Returns
bool Returns TRUE if no redirect URL is set and no hook disables the output.

Definition at line 3665 of file TypoScriptFrontendController.php.

References GeneralUtility\callUserFunction().

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)

Returns
bool

Definition at line 3811 of file TypoScriptFrontendController.php.

References TypoScriptFrontendController\isINTincScript(), and TypoScriptFrontendController\isUserOrGroupSet().

Referenced by TypoScriptFrontendController\sendCacheHeaders().

isUserOrGroupSet ( )

Checking if a user is logged in or a group constellation different from "0,-1"

Returns
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!)

Definition at line 1156 of file TypoScriptFrontendController.php.

Referenced by TypoScriptFrontendController\determineId(), and TypoScriptFrontendController\isStaticCacheble().

jumpUrl ( )

Sends a header "Location" to jumpUrl, if jumpurl is set. Will exit if a location header is sent (for instance if jumpUrl was triggered)

"jumpUrl" is a concept where external links are redirected from the TYPO3 Frontend, but first logs the URL.

Exceptions
\Exception
Returns
void
Deprecated:
since TYPO3 CMS 7, will be removed in TYPO3 CMS 8. JumpURL handling is moved to extensions.

Definition at line 2933 of file TypoScriptFrontendController.php.

References GeneralUtility\logDeprecatedFunction(), and TypoScriptFrontendController\redirectToExternalUrl().

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.

Parameters
string$typoScriptPropertyDeprecated object or property
string$explanationMessage or additional information
Returns
void

Definition at line 4125 of file TypoScriptFrontendController.php.

References GeneralUtility\deprecationLog(), and TypoScriptFrontendController\getTimeTracker().

makeCacheHash ( )

Calculates a hash string based on additional parameters in the url.

Calculated hash is stored in $this->cHash_array. This is used to cache pages with more parameters than just id and type.

Returns
void
See Also
reqCHash()

Definition at line 2273 of file TypoScriptFrontendController.php.

References GeneralUtility\_GET(), TypoScriptFrontendController\disableCache(), elseif, TypoScriptFrontendController\getTimeTracker(), GeneralUtility\implodeArrayForUrl(), TypoScriptFrontendController\pageNotFoundAndExit(), and TypoScriptFrontendController\reqCHash().

mergingWithGetVars (   $GET_VARS)

Merging values into the global $_GET

Parameters
array$GET_VARSArray of key/value pairs that will be merged into the current GET-vars. (Non-escaped values)
Returns
void

Definition at line 2227 of file TypoScriptFrontendController.php.

References GeneralUtility\_GET(), GeneralUtility\_GETset(), ArrayUtility\mergeRecursiveWithOverrule(), and TypoScriptFrontendController\set_no_cache().

newCObj ( )

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

Returns
void
See Also
pagegen.php

Definition at line 4045 of file TypoScriptFrontendController.php.

References GeneralUtility\makeInstance().

Referenced by TypoScriptFrontendController\prefixLocalAnchorsWithScript().

pageErrorHandler (   $code,
  $header = '',
  $reason = '' 
)

Generic error page handler. Exits.

Parameters
mixed$codeWhich type of handling; If a true PHP-boolean or TRUE then a is outputted. If integer an error message with that number is shown. Otherwise the $code value is expected to be a "Location:" header value.
string$headerIf set, this is passed directly to the PHP function, header()
string$reasonIf set, error messages will also mention this as the reason for the page-not-found.
Exceptions
\RuntimeException
Returns
void (The function exits!)

Definition at line 2074 of file TypoScriptFrontendController.php.

References TypoScriptFrontendController\$content, GeneralUtility\callUserFunction(), elseif, GeneralUtility\getFileAbsFileName(), GeneralUtility\getIndpEnv(), TypoScriptFrontendController\getPageAccessFailureReasons(), GeneralUtility\getUrl(), GeneralUtility\isFirstPartOfStr(), GeneralUtility\makeInstance(), and HttpUtility\redirect().

Referenced by TypoScriptFrontendController\pageNotFoundHandler(), and TypoScriptFrontendController\pageUnavailableHandler().

pageNotFoundAndExit (   $reason = '',
  $header = '' 
)

Page-not-found handler for use in frontend plugins from extensions.

Parameters
string$reasonReason text
string$headerHTTP header to send
Returns
void Function exits.

Definition at line 2009 of file TypoScriptFrontendController.php.

References TypoScriptFrontendController\pageNotFoundHandler().

Referenced by TypoScriptFrontendController\fetch_the_id(), TypoScriptFrontendController\getPageAndRootline(), TypoScriptFrontendController\makeCacheHash(), TypoScriptFrontendController\reqCHash(), and TypoScriptFrontendController\settingLanguage().

pageNotFoundHandler (   $code,
  $header = '',
  $reason = '' 
)

Page not found handler. Acts a wrapper for the pageErrorHandler method.

Parameters
mixed$codeWhich type of handling; If a true PHP-boolean or TRUE then a is outputted. If integer an error message with that number is shown. Otherwise the $code value is expected to be a "Location:" header value.
string$headerIf set, this is passed directly to the PHP function, header()
string$reasonIf set, error messages will also mention this as the reason for the page-not-found.
Returns
void (The function exits!)

Definition at line 2059 of file TypoScriptFrontendController.php.

References TypoScriptFrontendController\pageErrorHandler().

Referenced by TypoScriptFrontendController\pageNotFoundAndExit().

pageUnavailableAndExit (   $reason = '',
  $header = '' 
)

Page unavailable handler for use in frontend plugins from extensions.

Parameters
string$reasonReason text
string$headerHTTP header to send
Returns
void Function exits.

Definition at line 1995 of file TypoScriptFrontendController.php.

References TypoScriptFrontendController\pageUnavailableHandler().

Referenced by TypoScriptFrontendController\connectToDB(), TypoScriptFrontendController\fetch_the_id(), TypoScriptFrontendController\getConfigArray(), and TypoScriptFrontendController\getPageAndRootline().

pageUnavailableHandler (   $code,
  $header,
  $reason 
)

Page unavailable handler. Acts a wrapper for the pageErrorHandler method.

Parameters
mixed$codeWhich type of handling; If a true PHP-boolean or TRUE then a is outputted. If integer an error message with that number is shown. Otherwise the $code value is expected to be a "Location:" header value.
string$headerIf set, this is passed directly to the PHP function, header()
string$reasonIf set, error messages will also mention this as the reason for the page-not-found.
Returns
void (The function exits!)

Definition at line 2046 of file TypoScriptFrontendController.php.

References TypoScriptFrontendController\pageErrorHandler().

Referenced by TypoScriptFrontendController\pageUnavailableAndExit().

prefixLocalAnchorsWithScript ( )

Substitutes all occurencies of <a href="#"... in $this->content with <a href="[path-to-url]#"...

Returns
void Works directly on $this->content
Deprecated:
since TYPO3 CMS 7, will be removed with TYPO3 CMS 8

Definition at line 4150 of file TypoScriptFrontendController.php.

References TypoScriptFrontendController\$content, TypoScriptFrontendController\disableCache(), GeneralUtility\getIndpEnv(), GeneralUtility\logDeprecatedFunction(), TypoScriptFrontendController\newCObj(), and GeneralUtility\SYSLOG_SEVERITY_FATAL.

previewInfo ( )

Outputs preview info.

Returns
void

Definition at line 3894 of file TypoScriptFrontendController.php.

References GeneralUtility\callUserFunction().

processOutput ( )

Process the output before it's actually outputted. Sends headers also.

This includes substituting the "username" comment, sending additional headers (as defined in the TypoScript "config.additionalheaders" object), XHTML cleaning content (if configured) Works on $this->content.

Returns
void

Definition at line 3688 of file TypoScriptFrontendController.php.

References TypoScriptFrontendController\addTempContentHttpHeaders(), GeneralUtility\callUserFunction(), TypoScriptFrontendController\contentStrReplace(), GeneralUtility\deprecationLog(), TypoScriptFrontendController\doWorkspacePreview(), and TypoScriptFrontendController\sendCacheHeaders().

realPageCacheContent ( )
recursivelyReplaceIntPlaceholdersInContent ( )
protected

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 3507 of file TypoScriptFrontendController.php.

References TypoScriptFrontendController\INTincScript_includeLibs(), and TypoScriptFrontendController\INTincScript_process().

redirectToExternalUrl ( )

Loops over all registered URL handlers and lets them process the current URL.

If no handler has stopped the current process (e.g. by redirecting) and a the redirectUrl propert is not empty, the user will be redirected to this URL.

Definition at line 2947 of file TypoScriptFrontendController.php.

Referenced by TypoScriptFrontendController\jumpUrl().

regeneratePageTitle ( )
protected

Generate the page title again as TSFE->altPageTitle might have been modified by an inc script

Returns
void

Definition at line 3450 of file TypoScriptFrontendController.php.

releaseLock (   $type)
protected

Release a page specific lock

Parameters
string$type
Exceptions
\InvalidArgumentException
\RuntimeException
\TYPO3\CMS\Core\Cache\Exception\NoSuchCacheException

Definition at line 4955 of file TypoScriptFrontendController.php.

References TypoScriptFrontendController\$type.

Referenced by TypoScriptFrontendController\generatePage_preProcessing(), TypoScriptFrontendController\getFromCache(), and TypoScriptFrontendController\releaseLocks().

releaseLocks ( )

Release pending locks

Definition at line 3326 of file TypoScriptFrontendController.php.

References TypoScriptFrontendController\releaseLock().

releasePageGenerationLock ( $lockObj)

Release the page generation lock

Parameters
Locker$lockObjReference to a locking object
Returns
bool Returns TRUE on success, FALSE otherwise
See Also
acquirePageGenerationLock()
Deprecated:
since TYPO3 CMS 7, will be removed with TYPO3 CMS 8

Definition at line 3305 of file TypoScriptFrontendController.php.

References elseif, Locker\getLockStatus(), TypoScriptFrontendController\headerNoCache(), and GeneralUtility\logDeprecatedFunction().

reqCHash ( )

Will disable caching if the cHash value was not set. This function should be called to check the existence of "&cHash" whenever a plugin generating cacheable output is using extra GET variables. If there is a cHash value the validation of it automatically takes place in makeCacheHash() (see above)

Returns
void
See Also
makeCacheHash(), ::pi_cHashCheck()

Definition at line 2306 of file TypoScriptFrontendController.php.

References TypoScriptFrontendController\clearPageCacheContent(), TypoScriptFrontendController\disableCache(), TypoScriptFrontendController\getTimeTracker(), and TypoScriptFrontendController\pageNotFoundAndExit().

Referenced by TypoScriptFrontendController\makeCacheHash().

sendCacheHeaders ( )

Send cache headers good for client/reverse proxy caching This function should not be called if the page content is temporary (like for "Page is being generated..." message, but in that case it is ok because the config-variables are not yet available and so will not allow to send cache headers)

Returns
void -author Ole Tange, Forbrugernes Hus, Denmark

Definition at line 3759 of file TypoScriptFrontendController.php.

References $GLOBALS, TypoScriptFrontendController\doWorkspacePreview(), TypoScriptFrontendController\getTimeTracker(), TypoScriptFrontendController\isINTincScript(), and TypoScriptFrontendController\isStaticCacheble().

Referenced by TypoScriptFrontendController\processOutput().

sendRedirect ( )

Looks up the value of $this->RDCT in the database and if it is found to be associated with a redirect URL then the redirection is carried out with a 'Location:' header May exit after sending a location-header.

Returns
void

Definition at line 1014 of file TypoScriptFrontendController.php.

References TypoScriptFrontendController\getDatabaseConnection(), and TypoScriptFrontendController\updateMD5paramsRecord().

set_cache_timeout_default (   $seconds)

Sets the cache-timeout in seconds

Parameters
int$secondsCache-timeout in seconds
Returns
void

Definition at line 4420 of file TypoScriptFrontendController.php.

set_no_cache (   $reason = '',
  $internal = 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.

Parameters
string$reasonAn optional reason to be written to the syslog.
bool$internalWhether the call is done from core itself (should only be used by core).
Returns
void

Definition at line 4369 of file TypoScriptFrontendController.php.

References $GLOBALS, StringUtility\beginsWith(), TypoScriptFrontendController\disableCache(), TypoScriptFrontendController\getTimeTracker(), GeneralUtility\SYSLOG_SEVERITY_NOTICE, and GeneralUtility\SYSLOG_SEVERITY_WARNING.

Referenced by TypoScriptFrontendController\fetch_the_id(), TypoScriptFrontendController\generatePage_postProcessing(), TypoScriptFrontendController\getConfigArray(), TypoScriptFrontendController\mergingWithGetVars(), and TypoScriptFrontendController\tempPageCacheContent().

setContentType (   $contentType)
Parameters
string$contentType

Definition at line 954 of file TypoScriptFrontendController.php.

References TypoScriptFrontendController\$contentType.

setCSS (   $key,
  $content 
)

Sets CSS data in the additionalCSS array

Parameters
string$keyIs the key in the array, for num-key let the value be empty
string$contentIs the content if you want any
Returns
void
See Also
setJS()

Definition at line 4343 of file TypoScriptFrontendController.php.

References TypoScriptFrontendController\$content.

setExternalJumpUrl ( )

Checks if the current page points to an external URL and stores this value in the redirectUrl variable. The redirection will then be handled by the redirectToExternalUrl() method.

Returns
void
Deprecated:
since TYPO3 CMS 7, will be removed in TYPO3 CMS 8. See handleExternalUrlPage()

Definition at line 2917 of file TypoScriptFrontendController.php.

References GeneralUtility\logDeprecatedFunction().

setIDfromArgV ( )

This checks if there are ARGV-parameters in the QUERY_STRING and if so, those are used for the id $this->id must be 'FALSE' in order for any processing to happen in here If an id/alias value is extracted from the QUERY_STRING it is set in $this->id

Returns
void private

Definition at line 1911 of file TypoScriptFrontendController.php.

References GeneralUtility\getIndpEnv().

Referenced by TypoScriptFrontendController\determineId().

setJS (   $key,
  $content = '' 
)

Sets JavaScript code in the additionalJavaScript array

Parameters
string$keyis the key in the array, for num-key let the value be empty. Note reserved keys 'openPic' and 'mouseOver'
string$contentis the content if you want any
Returns
void
See Also
::writeMenu(), ContentObjectRenderer::imageLinkWrap()

Definition at line 4305 of file TypoScriptFrontendController.php.

References TypoScriptFrontendController\$content.

setPageCacheContent (   $content,
  $data,
  $expirationTstamp 
)

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

Parameters
string$contentThe content to store in the HTML field of the cache table
mixed$dataThe additional cache_data array, fx. $this->config
int$expirationTstampExpiration timestamp
Returns
void
See Also
realPageCacheContent(), tempPageCacheContent()

Definition at line 3189 of file TypoScriptFrontendController.php.

References TypoScriptFrontendController\$content, $GLOBALS, and GeneralUtility\trimExplode().

Referenced by TypoScriptFrontendController\realPageCacheContent(), and TypoScriptFrontendController\tempPageCacheContent().

setParseTime ( )

Sets the parsetime of the page.

Returns
void private

Definition at line 3878 of file TypoScriptFrontendController.php.

References $GLOBALS, and TypoScriptFrontendController\getTimeTracker().

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.

Returns
void
See Also
ContentObjectRenderer::lastChanged()

Definition at line 3250 of file TypoScriptFrontendController.php.

References TypoScriptFrontendController\getDatabaseConnection(), and TypoScriptFrontendController\whichWorkspace().

Referenced by TypoScriptFrontendController\generatePage_postProcessing().

setSysPageWhereClause ( )

Sets sys_page where-clause

Returns
void private

Definition at line 1956 of file TypoScriptFrontendController.php.

Referenced by TypoScriptFrontendController\fetch_the_id().

settingLanguage ( )
settingLocale ( )

Setting locale for frontend rendering

Returns
void

Definition at line 2814 of file TypoScriptFrontendController.php.

References TypoScriptFrontendController\getTimeTracker().

setUrlIdToken ( )

Sets the URL_ID_TOKEN in the internal var, $this->getMethodUrlIdToken This feature allows sessions to use a GET-parameter instead of a cookie.

Returns
void private

Definition at line 2965 of file TypoScriptFrontendController.php.

sL (   $input)

Split Label function for front-end applications.

Parameters
string$inputKey string. Accepts the "LLL:" prefix.
Returns
string Label value, if any.

Definition at line 4504 of file TypoScriptFrontendController.php.

References TypoScriptFrontendController\$lang, and TypoScriptFrontendController\getLLL().

storeSessionData ( )

Stores session data for the front end user

Returns
void

Definition at line 3867 of file TypoScriptFrontendController.php.

tempPageCacheContent ( )

Temp cache content The temporary cache will expire after a few seconds (typ. 30) or will be cleared by the rendered page, which will also clear and rewrite the cache.

Returns
void

Definition at line 3093 of file TypoScriptFrontendController.php.

References $GLOBALS, TypoScriptFrontendController\getFromCache_queryRow(), GeneralUtility\getIndpEnv(), TypoScriptFrontendController\headerNoCache(), TypoScriptFrontendController\set_no_cache(), and TypoScriptFrontendController\setPageCacheContent().

Referenced by TypoScriptFrontendController\generatePage_preProcessing().

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.

Parameters
string$strSome string to include in what is hashed. Not significant at all.
Returns
string MD5 hash of ->uniqueString, input string and uniqueCounter

Definition at line 4357 of file TypoScriptFrontendController.php.

Referenced by TypoScriptFrontendController\getUniqueId().

updateMD5paramsRecord (   $hash)

Updates the tstamp field of a cache_md5params record to the current time.

Parameters
string$hashThe hash string identifying the cache_md5params record for which to update the "tstamp" field to the current time.
Returns
void private

Definition at line 4139 of file TypoScriptFrontendController.php.

References $GLOBALS, and TypoScriptFrontendController\getDatabaseConnection().

Referenced by TypoScriptFrontendController\sendRedirect().

updateRootLinesWithTranslations ( )
protected

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

Definition at line 2801 of file TypoScriptFrontendController.php.

Referenced by TypoScriptFrontendController\settingLanguage().

whichWorkspace (   $returnTitle = false)

Returns the name of the workspace

Parameters
bool$returnTitleIf set, returns title of current workspace being previewed
Returns
string|int|NULL If $returnTitle is set, returns string (title), otherwise workspace integer for which workspace is being preview. NULL if none.

Definition at line 4193 of file TypoScriptFrontendController.php.

References TypoScriptFrontendController\doWorkspacePreview(), elseif, TypoScriptFrontendController\getBackendUser(), TypoScriptFrontendController\getDatabaseConnection(), and ExtensionManagementUtility\isLoaded().

Referenced by TypoScriptFrontendController\determineId(), TypoScriptFrontendController\determineIdIsHiddenPage(), TypoScriptFrontendController\fetch_the_id(), TypoScriptFrontendController\getPageAndRootline(), and TypoScriptFrontendController\setSysLastChanged().

Member Data Documentation

$absRefPrefix = ''

Definition at line 519 of file TypoScriptFrontendController.php.

$accessKey = array()

Definition at line 669 of file TypoScriptFrontendController.php.

$activeUrlHandlers = []
protected

Definition at line 150 of file TypoScriptFrontendController.php.

$additionalCSS = array()
$additionalFooterData = array()

Definition at line 420 of file TypoScriptFrontendController.php.

$additionalHeaderData = array()

Definition at line 414 of file TypoScriptFrontendController.php.

$additionalJavaScript = array()
$ADMCMD_preview_BEUSER_uid = 0

Definition at line 247 of file TypoScriptFrontendController.php.

$all = array()
$altPageTitle = ''

Definition at line 709 of file TypoScriptFrontendController.php.

$anchorPrefix = ''

Definition at line 723 of file TypoScriptFrontendController.php.

$applicationData = array()

Definition at line 627 of file TypoScriptFrontendController.php.

$ATagParams = ''

Definition at line 537 of file TypoScriptFrontendController.php.

$baseUrl = ''

Definition at line 715 of file TypoScriptFrontendController.php.

$beUserLogin = false
$cacheContentFlag = false

Definition at line 312 of file TypoScriptFrontendController.php.

$cacheExpires = 0

Definition at line 318 of file TypoScriptFrontendController.php.

$cacheHash
protected

Definition at line 842 of file TypoScriptFrontendController.php.

$cacheTimeOutDefault = false

Definition at line 305 of file TypoScriptFrontendController.php.

$cHash = ''
$cHash_array = array()

Definition at line 389 of file TypoScriptFrontendController.php.

$clientInfo = ''

Definition at line 748 of file TypoScriptFrontendController.php.

$cObj = ''

Definition at line 736 of file TypoScriptFrontendController.php.

$cObjectDepthCounter = 50

Definition at line 646 of file TypoScriptFrontendController.php.

$compensateFieldWidth = ''

Definition at line 525 of file TypoScriptFrontendController.php.

$config = ''

Definition at line 291 of file TypoScriptFrontendController.php.

$content = ''
$contentPid = 0

Definition at line 108 of file TypoScriptFrontendController.php.

$contentType = 'text/html'
protected

Content type HTTP header being sent in the request.

Todo:
Ticket: #63642 Should be refactored to a request/response model later

Definition at line 858 of file TypoScriptFrontendController.php.

Referenced by TypoScriptFrontendController\setContentType().

$csConvObj

Definition at line 761 of file TypoScriptFrontendController.php.

$currentRecord = ''

Definition at line 662 of file TypoScriptFrontendController.php.

$debug = ''

Definition at line 482 of file TypoScriptFrontendController.php.

$defaultBodyTag = '<body>'

Definition at line 476 of file TypoScriptFrontendController.php.

$defaultCharSet = 'utf-8'

Definition at line 767 of file TypoScriptFrontendController.php.

$displayEditIcons = ''

Definition at line 575 of file TypoScriptFrontendController.php.

$displayFieldEditIcons = ''

Definition at line 583 of file TypoScriptFrontendController.php.

$divSection = ''

Definition at line 469 of file TypoScriptFrontendController.php.

$domainDataCache = array()
protected

Definition at line 849 of file TypoScriptFrontendController.php.

$domainStartPage = 0
$dtdAllowsFrames

Definition at line 884 of file TypoScriptFrontendController.php.

$excludeCHashVars = ''

Definition at line 568 of file TypoScriptFrontendController.php.

$extTarget = ''

Definition at line 494 of file TypoScriptFrontendController.php.

$fe_user = ''

Definition at line 201 of file TypoScriptFrontendController.php.

$fePreview = 0

Definition at line 256 of file TypoScriptFrontendController.php.

$fileTarget = ''

Definition at line 500 of file TypoScriptFrontendController.php.

$forceTemplateParsing = false
$getMethodUrlIdToken = ''
$gr_list = ''
$id = ''
$imagesOnPage = array()

Definition at line 676 of file TypoScriptFrontendController.php.

$indexedDocTitle = ''

Definition at line 702 of file TypoScriptFrontendController.php.

$inlineJS

Definition at line 463 of file TypoScriptFrontendController.php.

$intTarget = ''

Definition at line 488 of file TypoScriptFrontendController.php.

$isClientCachable = false

Definition at line 324 of file TypoScriptFrontendController.php.

$JSCode

Definition at line 458 of file TypoScriptFrontendController.php.

$JSeventFuncCalls
Initial value:
= array(
'onmousemove' => array(),
'onmouseup' => array(),
'onkeydown' => array(),
'onkeyup' => array(),
'onkeypress' => array(),
'onload' => array(),
'onunload' => array()
)

Definition at line 445 of file TypoScriptFrontendController.php.

$jumpurl = ''
$lang = ''
$languageDependencies = array()
protected

Definition at line 812 of file TypoScriptFrontendController.php.

$lastImageInfo = array()

Definition at line 683 of file TypoScriptFrontendController.php.

$linkVars = ''
$LL_files_cache = array()

Definition at line 803 of file TypoScriptFrontendController.php.

$LL_labels_cache = array()

Definition at line 798 of file TypoScriptFrontendController.php.

$localeCharset = ''

Definition at line 787 of file TypoScriptFrontendController.php.

$lockFilePath = ''

Definition at line 531 of file TypoScriptFrontendController.php.

$locks = []
protected

Definition at line 817 of file TypoScriptFrontendController.php.

$loginAllowedInBranch = true

Definition at line 235 of file TypoScriptFrontendController.php.

$loginAllowedInBranch_mode = ''

Definition at line 241 of file TypoScriptFrontendController.php.

$loginUser = false

Definition at line 209 of file TypoScriptFrontendController.php.

$metaCharset = 'utf-8'

Definition at line 781 of file TypoScriptFrontendController.php.

$MP = ''
$MP_defaults = array()

Definition at line 507 of file TypoScriptFrontendController.php.

$newHash = ''

Definition at line 352 of file TypoScriptFrontendController.php.

$no_cache = false
$no_cacheBeforePageGen = false

Definition at line 370 of file TypoScriptFrontendController.php.

$originalMountPointPage = null
protected

Definition at line 117 of file TypoScriptFrontendController.php.

$originalShortcutPage = null
protected

Definition at line 127 of file TypoScriptFrontendController.php.

$page = ''
$page_cache_reg1 = 0

Definition at line 186 of file TypoScriptFrontendController.php.

$pageAccessFailureHistory = array()

Definition at line 168 of file TypoScriptFrontendController.php.

$pageCache
protected

Definition at line 830 of file TypoScriptFrontendController.php.

$pageCacheTags = array()
protected

Definition at line 835 of file TypoScriptFrontendController.php.

$pageNotFound = 0

Definition at line 156 of file TypoScriptFrontendController.php.

$pageRenderer = null
protected
$pagesTSconfig = ''
$pSetup = ''

Definition at line 345 of file TypoScriptFrontendController.php.

$RDCT = ''
$recordRegister = array()

Definition at line 653 of file TypoScriptFrontendController.php.

$register = array()

Definition at line 632 of file TypoScriptFrontendController.php.

$registerStack = array()

Definition at line 639 of file TypoScriptFrontendController.php.

$renderCharset = 'utf-8'
$requestedId
protected

Definition at line 879 of file TypoScriptFrontendController.php.

$rootLine = ''

Definition at line 95 of file TypoScriptFrontendController.php.

$scriptParseTime = 0

Definition at line 753 of file TypoScriptFrontendController.php.

$showHiddenPage = false

Definition at line 263 of file TypoScriptFrontendController.php.

$showHiddenRecords = false
$simUserGroup = 0
$siteScript = ''

Definition at line 194 of file TypoScriptFrontendController.php.

$spamProtectEmailAddresses = 0

Definition at line 513 of file TypoScriptFrontendController.php.

$sPre = ''

Definition at line 338 of file TypoScriptFrontendController.php.

$sWordList = ''

Definition at line 552 of file TypoScriptFrontendController.php.

$sWordRegEx = ''

Definition at line 545 of file TypoScriptFrontendController.php.

$sys_language_content = 0
$sys_language_contentOL = 0

Definition at line 613 of file TypoScriptFrontendController.php.

$sys_language_isocode = ''

Definition at line 620 of file TypoScriptFrontendController.php.

$sys_language_mode = ''

Definition at line 598 of file TypoScriptFrontendController.php.

$sys_language_uid = 0
$sys_page = ''

Definition at line 134 of file TypoScriptFrontendController.php.

$tempContent = false

Definition at line 377 of file TypoScriptFrontendController.php.

$tmpl = null

Definition at line 298 of file TypoScriptFrontendController.php.

$type = ''
$TYPO3_CONF_VARS = array()
$uniqueCounter = 0

Definition at line 690 of file TypoScriptFrontendController.php.

$uniqueString = ''

Definition at line 695 of file TypoScriptFrontendController.php.

$usedUniqueIds = array()
private

Definition at line 729 of file TypoScriptFrontendController.php.

$workspacePreview = 0

Definition at line 229 of file TypoScriptFrontendController.php.

$xhtmlDoctype = ''

Definition at line 867 of file TypoScriptFrontendController.php.

$xhtmlVersion

Definition at line 872 of file TypoScriptFrontendController.php.