Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace DMF\Intranet\Service;
- use TYPO3\CMS\Core\SingletonInterface;
- use TYPO3\CMS\Core\TimeTracker\TimeTracker;
- use TYPO3\CMS\Core\Utility\GeneralUtility;
- use TYPO3\CMS\Extbase\Object\ObjectManager;
- require_once(PATH_tslib . 'class.tslib_fe.php');
- require_once(PATH_t3lib . 'class.t3lib_userauth.php');
- require_once(PATH_tslib . 'class.tslib_feuserauth.php');
- require_once(PATH_t3lib . 'class.t3lib_cs.php');
- require_once(PATH_tslib . 'class.tslib_content.php');
- require_once(PATH_t3lib . 'class.t3lib_tstemplate.php');
- require_once(PATH_t3lib . 'class.t3lib_page.php');
- /**
- * Class BuildTsfeService
- *
- * @package DMF\Intranet\Service
- */
- class BuildTsfeService implements SingletonInterface {
- /**
- * @var ObjectManager
- */
- protected $objectManager;
- /**
- * @param ObjectManager $objectManager
- */
- public function injectObjectManager(ObjectManager $objectManager) {
- $this->objectManager = $objectManager;
- }
- /**
- *
- */
- public function buildTSFE($pid = 1) {
- if (!is_object($GLOBALS['TT'])) {
- $GLOBALS['TT'] = new TimeTracker();
- $GLOBALS['TT']->start();
- }
- $TSFEclassName = $this->objectManager->get('TYPO3\\CMS\\Frontend\\Controller\\TypoScriptFrontendController');
- $GLOBALS['TSFE'] = new $TSFEclassName($GLOBALS['TYPO3_CONF_VARS'], $pid, '0', 1, '', '', '', '');
- $GLOBALS['TSFE']->connectToDB();
- $GLOBALS['TSFE']->initFEuser();
- $GLOBALS['TSFE']->fetch_the_id();
- $GLOBALS['TSFE']->getPageAndRootline();
- $GLOBALS['TSFE']->initTemplate();
- $GLOBALS['TSFE']->tmpl->getFileName_backPath = PATH_site;
- $GLOBALS['TSFE']->forceTemplateParsing = 1;
- $GLOBALS['TSFE']->getConfigArray();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement