diff --git a/Classes/Client.php b/Classes/Client.php index 83ceeeb..5b66986 100644 --- a/Classes/Client.php +++ b/Classes/Client.php @@ -13,15 +13,19 @@ use Psr\Http\Message\ServerRequestInterface; use T3Monitor\T3monitoringClient\Provider\DataProviderInterface; use TYPO3\CMS\Core\Configuration\ExtensionConfiguration; +use TYPO3\CMS\Core\Context\Context; use TYPO3\CMS\Core\Core\Bootstrap; +use TYPO3\CMS\Core\Core\SystemEnvironmentBuilder; use TYPO3\CMS\Core\Http\NormalizedParams; use TYPO3\CMS\Core\Http\Response; use TYPO3\CMS\Core\Http\ServerRequestFactory; use TYPO3\CMS\Core\Http\Uri; +use TYPO3\CMS\Core\Routing\PageArguments; use TYPO3\CMS\Core\Site\Entity\NullSite; use TYPO3\CMS\Core\Site\Entity\SiteLanguage; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Core\Utility\VersionNumberUtility; +use TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication; use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController; /** @@ -104,13 +108,20 @@ protected function collectData() if ($isv10) { // create a dummy TSFE as it is injected into ContentObjectRenderer, which is used indirectly by status reports $siteLanguage = new SiteLanguage(0, 'en_US', new Uri(), []); - $GLOBALS['TSFE'] = GeneralUtility::makeInstance(TypoScriptFrontendController::class, null, new NullSite(), $siteLanguage); + $GLOBALS['TSFE'] = GeneralUtility::makeInstance( + TypoScriptFrontendController::class, + GeneralUtility::makeInstance(Context::class), + new NullSite(), + $siteLanguage, + new PageArguments(0, '0', []), + GeneralUtility::makeInstance(FrontendUserAuthentication::class) + ); } // Since 10.4.16, the internal ExtensionProvider requires a request if (!($GLOBALS['TYPO3_REQUEST'] ?? null)) { $request = ServerRequestFactory::fromGlobals(); - $GLOBALS['TYPO3_REQUEST'] = $request->withAttribute('normalizedParams', NormalizedParams::createFromRequest($request)); + $GLOBALS['TYPO3_REQUEST'] = $request->withAttribute('applicationType', SystemEnvironmentBuilder::REQUESTTYPE_FE); } foreach ($classes as $class) { diff --git a/Classes/Provider/ExtensionProvider.php b/Classes/Provider/ExtensionProvider.php index dbe73f0..d869f2f 100644 --- a/Classes/Provider/ExtensionProvider.php +++ b/Classes/Provider/ExtensionProvider.php @@ -30,7 +30,8 @@ class ExtensionProvider implements DataProviderInterface */ public function get(array $data) { - $hasNewEmConfApi = VersionNumberUtility::convertVersionNumberToInteger('10.2') < VersionNumberUtility::convertVersionNumberToInteger(TYPO3_branch); + $isv11 = VersionNumberUtility::convertVersionNumberToInteger('11.2') < VersionNumberUtility::convertVersionNumberToInteger(TYPO3_branch); + $isv10 = VersionNumberUtility::convertVersionNumberToInteger('10.2') < VersionNumberUtility::convertVersionNumberToInteger(TYPO3_branch); $objectManager = GeneralUtility::makeInstance(ObjectManager::class); $listUtility = $objectManager->get(ListUtility::class); @@ -42,7 +43,14 @@ public function get(array $data) continue; } - $data['extensions'][$key] = $hasNewEmConfApi ? $emConfUtility->includeEmConf($key, $f) : $emConfUtility->includeEmConf($f); + if ($isv11) { + $data['extensions'][$key] = $emConfUtility->includeEmConf($key, $f['packagePath']); + } elseif ($isv10) { + $data['extensions'][$key] = $emConfUtility->includeEmConf($key, $f); + } else { + $data['extensions'][$key] = $emConfUtility->includeEmConf($f); + } + $data['extensions'][$key]['isLoaded'] = (int)ExtensionManagementUtility::isLoaded($key); } diff --git a/README.rst b/README.rst index 6dfa6a4..68febb9 100644 --- a/README.rst +++ b/README.rst @@ -4,7 +4,7 @@ This extensions provides a client for the the extension **t3monitoring**. **Requirements** -- TYPO3 CMS 9.5 LTS or 10.2+ +- TYPO3 CMS 9.5 LTS, 10.4 LTS or 11.3+ - Use the branch `4-5` for support from 4.5 - 6.1 - Use the branch `7-8` for support from 7.0 - 8.7