diff --git a/Classes/Bootstrap.php b/Classes/Bootstrap.php new file mode 100644 index 0000000..b156a28 --- /dev/null +++ b/Classes/Bootstrap.php @@ -0,0 +1,17 @@ +registerImplementation( - \Codappix\SearchCore\Compatibility\TypoScriptServiceInterface::class, - \Codappix\SearchCore\Compatibility\TypoScriptService::class - ); + if (VersionNumberUtility::convertVersionNumberToInteger(TYPO3_version) >= 9000000) { + $container->registerImplementation( + ExtensionConfigurationInterface::class, + ExtensionConfiguration::class + ); - $container->registerImplementation( - \Codappix\SearchCore\Domain\Index\TcaIndexer\TcaTableServiceInterface::class, - \Codappix\SearchCore\Domain\Index\TcaIndexer\TcaTableService::class - ); + $container->registerImplementation( + TypoScriptServiceInterface::class, + TypoScriptService::class + ); + + $container->registerImplementation( + TcaTableServiceInterface::class, + TcaTableService::class + ); + } else if (VersionNumberUtility::convertVersionNumberToInteger(TYPO3_version) >= 8000000) { + $container->registerImplementation( + ExtensionConfigurationInterface::class, + ExtensionConfiguration87::class + ); + + $container->registerImplementation( + TypoScriptServiceInterface::class, + TypoScriptService::class + ); + + $container->registerImplementation( + TcaTableServiceInterface::class, + TcaTableService::class + ); + } } } diff --git a/Classes/Utility/ExtensionConfiguration.php b/Classes/Utility/ExtensionConfiguration.php new file mode 100644 index 0000000..029cd3c --- /dev/null +++ b/Classes/Utility/ExtensionConfiguration.php @@ -0,0 +1,7 @@ +get($extensionKey); - + $extensionConfiguration = \Codappix\SearchCore\Bootstrap::getObjectManager()->get(\Codappix\SearchCore\Utility\ExtensionConfigurationInterface::class)->get($extensionKey); + if ($extensionConfiguration === false || !isset($extensionConfiguration['disable']['elasticsearch']) || $extensionConfiguration['disable']['elasticsearch'] !== '1'