TYPO3 CMS  TYPO3_6-2
FrontendSimulatorUtility.php
Go to the documentation of this file.
1 <?php
3 
22 
26  static protected $tsfeBackup;
27 
35  static public function simulateFrontendEnvironment(\TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer $cObj = NULL) {
36  self::$tsfeBackup = isset($GLOBALS['TSFE']) ? $GLOBALS['TSFE'] : NULL;
37  $GLOBALS['TSFE'] = new \stdClass();
38  $GLOBALS['TSFE']->cObjectDepthCounter = 100;
39  $GLOBALS['TSFE']->cObj = $cObj !== NULL ? $cObj : \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectRenderer');
40  }
41 
48  static public function resetFrontendEnvironment() {
49  if (!empty(self::$tsfeBackup)) {
50  $GLOBALS['TSFE'] = self::$tsfeBackup;
51  }
52  }
53 }
static simulateFrontendEnvironment(\TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer $cObj=NULL)
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]