diff --git a/CHANGELOG.md b/CHANGELOG.md index d364f4e..64493d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,11 +1,5 @@ # Changelog -## 2.0.0 - 2023-05-06 - -- 💥 Drop support for TYPO3 v10 (3563604) -- ⬆ Add support for TYPO3 v12 (2af99f3) -- ✨🐛 Resolve deprecations introduced with TYPO3 v11 and v12 (89ee94b, 8264969) - ## 1.2.0 - 2022-08-10 - [FEATURE] Add support for TYPO3 v11 and PHP 8.0 & 8.1 (25ccc28, 9c43bfc) diff --git a/Classes/Hooks/PageRendererPreProcess.php b/Classes/Hooks/PageRendererPreProcess.php index 8065b11..02cf04d 100644 --- a/Classes/Hooks/PageRendererPreProcess.php +++ b/Classes/Hooks/PageRendererPreProcess.php @@ -4,7 +4,6 @@ namespace MMK2410\PlausibleAnalytics\Hooks; use TYPO3\CMS\Core\Page\AssetCollector; use TYPO3\CMS\Core\Utility\GeneralUtility; -use TYPO3\CMS\Core\Context\Context; class PageRendererPreProcess { @@ -14,30 +13,22 @@ class PageRendererPreProcess /** @var \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController */ private $tsfe; - /** @var Context */ - private $context; - public function __construct(AssetCollector $assetCollector = null) { $this->assetCollector = $assetCollector ?? GeneralUtility::makeInstance(AssetCollector::class); $this->tsfe = $GLOBALS['TSFE'] ?? null; - $this->context = GeneralUtility::makeInstance(Context::class); } public function addLibrary(): void { - if (!isset($this->tsfe)|| !isset($this->context)) { + if (!isset($this->tsfe)) { return; } $domain = $this->getDomain(); $plausible = $this->getPlausibleURL(); - if ( - isset($domain) && - isset($plausible) && - !$this->context->getPropertyFromAspect('backend.user', 'isLoggedIn') - ) { + if (isset($domain) && isset($plausible) && !$this->tsfe->isBackendUserLoggedIn()) { $this->assetCollector->addJavaScript( 'plausible_analytics', $plausible . '/js/plausible.js', diff --git a/composer.json b/composer.json index 80dfc9e..656fbed 100644 --- a/composer.json +++ b/composer.json @@ -22,8 +22,8 @@ } }, "require": { - "php": "7.4.0 - 8.2.99", - "typo3/cms-core": "^11.5 || ^12.4" + "php": "7.2.0 - 8.1.99", + "typo3/cms-core": "^10.4 || ^11.5" }, "replace": { "typo3-ter/plausible-analytics": "self.version" diff --git a/ext_emconf.php b/ext_emconf.php index 29ea66b..811bc10 100644 --- a/ext_emconf.php +++ b/ext_emconf.php @@ -8,11 +8,11 @@ $EM_CONF[$_EXTKEY] = [ 'author_email' => 'opensource@mmk2410.org', 'state' => 'stable', 'clearCacheOnLoad' => true, - 'version' => '2.0.0', + 'version' => '1.2.0', 'constraints' => [ 'depends' => [ - 'typo3' => '11.5.0-12.4.99', - 'php' => '7.4.0-8.2.99' + 'typo3' => '10.4.0-11.5.99', + 'php' => '7.2.0-8.1.99' ], ], 'autoload' => [ diff --git a/ext_localconf.php b/ext_localconf.php index d97af22..da336e7 100644 --- a/ext_localconf.php +++ b/ext_localconf.php @@ -1,6 +1,6 @@