diff --git a/Classes/Cache/Listener/StaticCacheableListener.php b/Classes/Cache/Listener/StaticCacheableListener.php index 5f50eb32dc6..73409911323 100644 --- a/Classes/Cache/Listener/StaticCacheableListener.php +++ b/Classes/Cache/Listener/StaticCacheableListener.php @@ -5,6 +5,8 @@ namespace SFC\Staticfilecache\Cache\Listener; use SFC\Staticfilecache\Event\CacheRuleEvent; +use TYPO3\CMS\Core\Information\Typo3Version; +use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController; /** @@ -20,8 +22,15 @@ class StaticCacheableListener */ public function __invoke(CacheRuleEvent $event): void { - if (($GLOBALS['TSFE'] ?? null) instanceof TypoScriptFrontendController && !$GLOBALS['TSFE']->isStaticCacheble()) { - $event->addExplanation(__CLASS__, 'The page is not static cacheable via TypoScriptFrontend. Check the first Question on: https://github.com/lochmueller/staticfilecache/blob/master/Documentation/Faq/Index.rst'); + if (($GLOBALS['TSFE'] ?? null) instanceof TypoScriptFrontendController) { + if (GeneralUtility::makeInstance(Typo3Version::class)->getMajorVersion() >= 13) { + $isStaticCacheble = $GLOBALS['TSFE']->isStaticCacheble($event->getRequest()); + } else { + $isStaticCacheble = $GLOBALS['TSFE']->isStaticCacheble(); + } + if(!$isStaticCacheble) { + $event->addExplanation(__CLASS__, 'The page is not static cacheable via TypoScriptFrontend. Check the first Question on: https://github.com/lochmueller/staticfilecache/blob/master/Documentation/Faq/Index.rst'); + } } } } diff --git a/Classes/Cache/Rule/LoginDeniedConfiguration.php b/Classes/Cache/Rule/LoginDeniedConfiguration.php deleted file mode 100644 index f7f8fad937c..00000000000 --- a/Classes/Cache/Rule/LoginDeniedConfiguration.php +++ /dev/null @@ -1,35 +0,0 @@ -config['config'][$name] ?? false; - if ($configActive && $tsfe->checkIfLoginAllowedInBranch()) { - $explanation[__CLASS__] = 'LoginDeniedCfg is true'; - } - } -} diff --git a/Classes/Configuration.php b/Classes/Configuration.php index 27fce2dbb63..38ce4f3aa28 100644 --- a/Classes/Configuration.php +++ b/Classes/Configuration.php @@ -8,7 +8,6 @@ use TYPO3\CMS\Core\Configuration\Exception\ExtensionConfigurationPathDoesNotExistException; use SFC\Staticfilecache\Cache\RemoteFileBackend; use SFC\Staticfilecache\Cache\Rule\Enable; -use SFC\Staticfilecache\Cache\Rule\LoginDeniedConfiguration; use SFC\Staticfilecache\Cache\Rule\NoFakeFrontend; use SFC\Staticfilecache\Cache\Rule\NoIntScripts; use SFC\Staticfilecache\Cache\Rule\NoLongPathSegment; @@ -38,7 +37,6 @@ use SFC\Staticfilecache\Service\ObjectFactoryService; use TYPO3\CMS\Core\Cache\Backend\NullBackend; use TYPO3\CMS\Core\Core\Environment; -use TYPO3\CMS\Core\Information\Typo3Version; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Extbase\Utility\ExtensionUtility; @@ -47,7 +45,6 @@ class Configuration extends StaticFileCacheObject public const EXTENSION_KEY = 'staticfilecache'; protected ConfigurationService $configurationService; - protected Typo3Version $typo3version; /** * Configuration constructor. @@ -58,7 +55,6 @@ class Configuration extends StaticFileCacheObject public function __construct() { $this->configurationService = GeneralUtility::makeInstance(ConfigurationService::class); - $this->typo3version = GeneralUtility::makeInstance(Typo3Version::class); } /** @@ -96,7 +92,6 @@ protected function registerRules(): self 'noWorkspacePreview' => NoWorkspacePreview::class, 'noUserOrGroupSet' => NoUserOrGroupSet::class, 'noIntScripts' => NoIntScripts::class, - 'loginDeniedConfiguration' => LoginDeniedConfiguration::class, 'noNoCache' => NoNoCache::class, 'enable' => Enable::class, 'validPageInformation' => ValidPageInformation::class,