From d1607ac1b4288d20255507429f982d7ba8a1e09a Mon Sep 17 00:00:00 2001 From: Daniel Maier Date: Tue, 30 Oct 2018 11:30:06 +0100 Subject: [PATCH] [task] resturcture compatibility layer --- Classes/Bootstrap.php | 11 +++++++++++ .../ExtensionConfiguration.php | 2 +- .../ExtensionConfigurationInterface.php | 2 +- .../ImplementationRegistrationService.php | 6 ++---- .../Version87/ExtensionConfiguration.php | 13 +++++++++++++ Classes/Utility/ExtensionConfiguration87.php | 11 ----------- ext_localconf.php | 2 +- 7 files changed, 29 insertions(+), 18 deletions(-) rename Classes/{Utility => Compatibility}/ExtensionConfiguration.php (75%) rename Classes/{Utility => Compatibility}/ExtensionConfigurationInterface.php (66%) create mode 100644 Classes/Compatibility/Version87/ExtensionConfiguration.php delete mode 100644 Classes/Utility/ExtensionConfiguration87.php diff --git a/Classes/Bootstrap.php b/Classes/Bootstrap.php index b156a28..ecfb784 100644 --- a/Classes/Bootstrap.php +++ b/Classes/Bootstrap.php @@ -2,6 +2,7 @@ namespace Codappix\SearchCore; +use Codappix\SearchCore\Compatibility\ExtensionConfigurationInterface; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Extbase\Object\ObjectManager; @@ -14,4 +15,14 @@ class Bootstrap { return GeneralUtility::makeInstance(ObjectManager::class); } + + /** + * @return ExtensionConfigurationInterface + */ + public static function getExtensionConfiguration() + { + return static::getObjectManager()->get( + ExtensionConfigurationInterface::class + ); + } } \ No newline at end of file diff --git a/Classes/Utility/ExtensionConfiguration.php b/Classes/Compatibility/ExtensionConfiguration.php similarity index 75% rename from Classes/Utility/ExtensionConfiguration.php rename to Classes/Compatibility/ExtensionConfiguration.php index 029cd3c..84a6509 100644 --- a/Classes/Utility/ExtensionConfiguration.php +++ b/Classes/Compatibility/ExtensionConfiguration.php @@ -1,6 +1,6 @@ = 8000000) { $container->registerImplementation( ExtensionConfigurationInterface::class, - ExtensionConfiguration87::class + Version87\ExtensionConfiguration::class ); $container->registerImplementation( diff --git a/Classes/Compatibility/Version87/ExtensionConfiguration.php b/Classes/Compatibility/Version87/ExtensionConfiguration.php new file mode 100644 index 0000000..86814fa --- /dev/null +++ b/Classes/Compatibility/Version87/ExtensionConfiguration.php @@ -0,0 +1,13 @@ +get(\Codappix\SearchCore\Utility\ExtensionConfigurationInterface::class)->get($extensionKey); + $extensionConfiguration = \Codappix\SearchCore\Bootstrap::getExtensionConfiguration()->get($extensionKey); if ($extensionConfiguration === false || !isset($extensionConfiguration['disable']['elasticsearch'])