Skip to content

Commit

Permalink
chore: cleanup the code
Browse files Browse the repository at this point in the history
  • Loading branch information
Jürgen Kußmann committed Jul 16, 2024
1 parent 489bb94 commit 1dba8cf
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions Classes/System/TYPO3/Loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,8 @@
use TYPO3\CMS\Core\Site\Entity\Site;
use TYPO3\CMS\Core\Site\SiteFinder;
use TYPO3\CMS\Core\TimeTracker\TimeTracker;
use TYPO3\CMS\Core\TypoScript\TemplateService;
use TYPO3\CMS\Core\TypoScript\FrontendTypoScript;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\Utility\VersionNumberUtility;
use TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication;
use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController;
use TYPO3\CMS\Frontend\Http\RequestHandler;
Expand Down Expand Up @@ -175,15 +174,7 @@ public function initializeFrontendRendering(int $pageId = 0, int $type = 0, bool
$controller->getContext()
->setAspect('typoscript', new TypoScriptAspect($forcedTemplateParsing));
}

if (VersionNumberUtility::convertVersionNumberToInteger(VersionNumberUtility::getNumericTypo3Version()) > 11005000) {
// it's TYPO3v11 or higher
$prepareTypoScriptFrontendRendering = new PrepareTypoScriptFrontendRendering($this->timeTracker);
} else {
// it's TYPO3v10 or lower
$prepareTypoScriptFrontendRendering = new PrepareTypoScriptFrontendRendering($GLOBALS['TSFE']);
}

$prepareTypoScriptFrontendRendering = new PrepareTypoScriptFrontendRendering($this->timeTracker);
$prepareTypoScriptFrontendRendering->process($this->getRequest(), $this->mockRequestHandler);
self::setRequest($this->mockRequestHandler->getRequest());
}
Expand Down Expand Up @@ -212,7 +203,8 @@ private function getRequest(): ServerRequestInterface

private function isFrontendInitialized(): bool
{
return ($GLOBALS['TSFE'] ?? null) instanceof TypoScriptFrontendController &&
$GLOBALS['TSFE']->tmpl instanceof TemplateService;
return ($GLOBALS['TYPO3_REQUEST'] ?? null) instanceof ServerRequestInterface &&
$GLOBALS['TYPO3_REQUEST']->getAttribute('frontend.controller') instanceof TypoScriptFrontendController &&
$GLOBALS['TYPO3_REQUEST']->getAttribute('frontend.typoscript') instanceof FrontendTypoScript;
}
}

0 comments on commit 1dba8cf

Please sign in to comment.