diff --git a/Classes/Bootstrap.php b/Classes/Bootstrap.php deleted file mode 100644 index 0cd8a89..0000000 --- a/Classes/Bootstrap.php +++ /dev/null @@ -1,27 +0,0 @@ -get( - ExtensionConfigurationInterface::class - ); - } -} diff --git a/Classes/Compatibility/ExtensionConfiguration.php b/Classes/Compatibility/ExtensionConfiguration.php deleted file mode 100644 index fb72775..0000000 --- a/Classes/Compatibility/ExtensionConfiguration.php +++ /dev/null @@ -1,26 +0,0 @@ -get(\TYPO3\CMS\Core\Configuration\ExtensionConfiguration::class); - } - - /** - * @param $extensionKey - * @return mixed - * @throws \TYPO3\CMS\Core\Configuration\Exception\ExtensionConfigurationExtensionNotConfiguredException - * @throws \TYPO3\CMS\Core\Configuration\Exception\ExtensionConfigurationPathDoesNotExistException - */ - public function get($extensionKey) - { - return $this->base()->get($extensionKey); - } -} diff --git a/Classes/Compatibility/ExtensionConfigurationInterface.php b/Classes/Compatibility/ExtensionConfigurationInterface.php deleted file mode 100644 index f62ab2d..0000000 --- a/Classes/Compatibility/ExtensionConfigurationInterface.php +++ /dev/null @@ -1,7 +0,0 @@ - - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - * 02110-1301, USA. - */ - -use Codappix\SearchCore\Domain\Index\TcaIndexer\TcaTableService; -use Codappix\SearchCore\Domain\Index\TcaIndexer\TcaTableServiceInterface; -use TYPO3\CMS\Core\Utility\GeneralUtility; -use TYPO3\CMS\Core\Utility\VersionNumberUtility; -use TYPO3\CMS\Extbase\Object\Container\Container; - -/** - * Register different concrete implementations, depending on current TYPO3 version. - * This way we can provide working implementations for multiple TYPO3 versions. - */ -class ImplementationRegistrationService -{ - public static function registerImplementations() - { - /** @var Container $container */ - $container = GeneralUtility::makeInstance(Container::class); - - if (VersionNumberUtility::convertVersionNumberToInteger(TYPO3_version) >= 9000000) { - $container->registerImplementation( - ExtensionConfigurationInterface::class, - ExtensionConfiguration::class - ); - } elseif (VersionNumberUtility::convertVersionNumberToInteger(TYPO3_version) >= 8000000) { - $container->registerImplementation( - ExtensionConfigurationInterface::class, - Version87\ExtensionConfiguration::class - ); - } - - $container->registerImplementation( - TypoScriptServiceInterface::class, - TypoScriptService::class - ); - - $container->registerImplementation( - TcaTableServiceInterface::class, - TcaTableService::class - ); - } -} diff --git a/Classes/Compatibility/TypoScriptService.php b/Classes/Compatibility/TypoScriptService.php deleted file mode 100644 index e5aa788..0000000 --- a/Classes/Compatibility/TypoScriptService.php +++ /dev/null @@ -1,31 +0,0 @@ - - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - * 02110-1301, USA. - */ - -use TYPO3\CMS\Core\TypoScript\TypoScriptService as CoreTypoScriptService; - -/** - * Used since TYPO3 CMS 8.7. - */ -class TypoScriptService extends CoreTypoScriptService implements TypoScriptServiceInterface -{ - -} diff --git a/Classes/Compatibility/TypoScriptServiceInterface.php b/Classes/Compatibility/TypoScriptServiceInterface.php deleted file mode 100644 index 8e6a9e4..0000000 --- a/Classes/Compatibility/TypoScriptServiceInterface.php +++ /dev/null @@ -1,30 +0,0 @@ - - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - * 02110-1301, USA. - */ - -/** - * Allows to use DI configuration to switch concrete implementation, depending - * on current TYPO3 Version. - */ -interface TypoScriptServiceInterface -{ - public function convertPlainArrayToTypoScriptArray(array $plainArray); -} diff --git a/Classes/Compatibility/Version87/ExtensionConfiguration.php b/Classes/Compatibility/Version87/ExtensionConfiguration.php deleted file mode 100644 index 6ff91af..0000000 --- a/Classes/Compatibility/Version87/ExtensionConfiguration.php +++ /dev/null @@ -1,13 +0,0 @@ -typoScriptService = $typoScriptService; } diff --git a/Tests/Functional/DataProcessing/ContentObjectDataProcessorAdapterProcessorTest.php b/Tests/Functional/DataProcessing/ContentObjectDataProcessorAdapterProcessorTest.php index bb997cf..0ebb3e5 100644 --- a/Tests/Functional/DataProcessing/ContentObjectDataProcessorAdapterProcessorTest.php +++ b/Tests/Functional/DataProcessing/ContentObjectDataProcessorAdapterProcessorTest.php @@ -20,8 +20,7 @@ namespace Codappix\SearchCore\Tests\Functional\DataProcessing; * 02110-1301, USA. */ -use Codappix\SearchCore\Compatibility\TypoScriptService76; -use Codappix\SearchCore\Compatibility\TypoScriptService; +use TYPO3\CMS\Core\TypoScript\TypoScriptService; use Codappix\SearchCore\DataProcessing\ContentObjectDataProcessorAdapterProcessor; use Codappix\SearchCore\Tests\Functional\AbstractFunctionalTestCase; use TYPO3\CMS\Frontend\DataProcessing\SplitProcessor; @@ -45,13 +44,7 @@ class ContentObjectDataProcessorAdapterProcessorTest extends AbstractFunctionalT 'new_content' => ['value1', 'value2'], ]; - if ($this->isLegacyVersion()) { - $typoScriptService = new TypoScriptService76(); - } else { - $typoScriptService = new TypoScriptService(); - } - - $subject = new ContentObjectDataProcessorAdapterProcessor($typoScriptService); + $subject = new ContentObjectDataProcessorAdapterProcessor(new TypoScriptService()); $processedData = $subject->processData($record, $configuration); $this->assertSame( $expectedData, diff --git a/ext_localconf.php b/ext_localconf.php index b492cd1..5a551f7 100644 --- a/ext_localconf.php +++ b/ext_localconf.php @@ -40,11 +40,9 @@ call_user_func( ] ); - \Codappix\SearchCore\Compatibility\ImplementationRegistrationService::registerImplementations(); - - - // API does make use of object manager, therefore use GLOBALS - $extensionConfiguration = \Codappix\SearchCore\Bootstrap::getExtensionConfiguration()->get($extensionKey); + $extensionConfiguration = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( + \TYPO3\CMS\Core\Configuration\ExtensionConfiguration::class + )->get($extensionKey); if ($extensionConfiguration === false || !isset($extensionConfiguration['disable']['elasticsearch'])