From 00f617ec545b5143ba8c04bff804f338cb6737e7 Mon Sep 17 00:00:00 2001 From: Philipp Kitzberger Date: Mon, 21 Mar 2022 16:26:25 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8TYPO3=2010=20compatibility=20(#48)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ✨ TYPO3 10 compatibility --- Classes/Task/GarbageCollector.php | 12 +++++------- composer.json | 13 +++++++++---- ext_emconf.php | 8 ++++---- ext_localconf.php | 4 ++-- 4 files changed, 20 insertions(+), 17 deletions(-) diff --git a/Classes/Task/GarbageCollector.php b/Classes/Task/GarbageCollector.php index aafa14d..5394d25 100644 --- a/Classes/Task/GarbageCollector.php +++ b/Classes/Task/GarbageCollector.php @@ -3,11 +3,11 @@ namespace KKSoftware\IndexedSearchGC\Task; use KKSoftware\IndexedSearchGC\Service\GarbageCollectorService; +use TYPO3\CMS\Core\Configuration\ExtensionConfiguration; use TYPO3\CMS\Core\Log\Logger; use TYPO3\CMS\Core\Log\LogManager; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Extbase\Object\ObjectManager; -use TYPO3\CMS\Extensionmanager\Utility\ConfigurationUtility; use TYPO3\CMS\Scheduler\Task\AbstractTask; /** @@ -37,15 +37,13 @@ public function execute() /** @var ObjectManager $om */ $om = GeneralUtility::makeInstance(ObjectManager::class); - /** @var ConfigurationUtility $configurationUtility */ - $configurationUtility = $om->get(ConfigurationUtility::class); - - $result = $configurationUtility->getCurrentConfiguration('indexed_search_gc'); + /** @var ExtensionConfiguration $extensionConfiguration */ + $extensionConfiguration = $om->get(ExtensionConfiguration::class); + $result = $extensionConfiguration->get('indexed_search_gc'); $this->logger->debug('Configuration Data', $result); - - $service = new GarbageCollectorService($result['garbageCollectionCleanupDelay']['value']); + $service = new GarbageCollectorService($result['garbageCollectionCleanupDelay']); $service->collect(); diff --git a/composer.json b/composer.json index a56d3c9..29b25b6 100644 --- a/composer.json +++ b/composer.json @@ -20,9 +20,9 @@ } ], "require": { - "typo3/cms-core": "^8.7.13", - "typo3/cms-indexed-search": "^8.7.13", - "typo3/cms-scheduler": "^8.7.13" + "typo3/cms-core": "^9.5 || ^10.4", + "typo3/cms-indexed-search": "^9.5 || ^10.4", + "typo3/cms-scheduler": "^9.5 || ^10.4" }, "require-dev": { "roave/security-advisories": "dev-master" @@ -31,5 +31,10 @@ "psr-4": { "KKSoftware\\IndexedSearchGC\\": "Classes" } + }, + "extra": { + "typo3/cms": { + "extension-key": "indexed_search_gc" + } } -} \ No newline at end of file +} diff --git a/ext_emconf.php b/ext_emconf.php index 08067e5..99ed041 100644 --- a/ext_emconf.php +++ b/ext_emconf.php @@ -1,6 +1,6 @@ 'Indexed Search Garbage Collector', 'description' => 'Provides a configurable Scheduler Task to Cleanup old IndexedSearch Entries', 'category' => 'plugin', @@ -14,9 +14,9 @@ 'version' => '1.0.0', 'constraints' => [ 'depends' => [ - 'typo3' => '8.7.0-8.7.99', - 'indexed_search' => '8.7.0-8.7.99', - 'scheduler' => '8.7.0-8.7.99' + 'typo3' => '9.5.0-10.4.99', + 'indexed_search' => '9.5.0-10.4.99', + 'scheduler' => '9.5.0-10.4.99' ], 'conflicts' => [], 'suggests' => [], diff --git a/ext_localconf.php b/ext_localconf.php index dca583b..9f355aa 100644 --- a/ext_localconf.php +++ b/ext_localconf.php @@ -8,8 +8,8 @@ * Configuration for Scheduler TASK */ $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][\KKSoftware\IndexedSearchGC\Task\GarbageCollector::class] = [ - 'extension' => $_EXTKEY, + 'extension' => 'indexed_search_gc', 'title' => 'Indexed Search Garbage Collection', 'description' => '', 'additionalFields' => '' -]; \ No newline at end of file +];