From 50baec90ec0ea3328d570bbc746126edeecf1e08 Mon Sep 17 00:00:00 2001 From: Daniel Maier Date: Wed, 17 Oct 2018 15:54:54 +0200 Subject: [PATCH] [task] migrate array utility --- Classes/Configuration/ConfigurationContainer.php | 2 +- Classes/Domain/Model/SearchRequest.php | 4 +++- Classes/Domain/Search/QueryFactory.php | 2 +- ext_localconf.php | 5 +++-- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Classes/Configuration/ConfigurationContainer.php b/Classes/Configuration/ConfigurationContainer.php index eab76e0..aaf0ebb 100644 --- a/Classes/Configuration/ConfigurationContainer.php +++ b/Classes/Configuration/ConfigurationContainer.php @@ -21,7 +21,7 @@ namespace Codappix\SearchCore\Configuration; */ use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface; -use TYPO3\CMS\Extbase\Utility\ArrayUtility; +use TYPO3\CMS\Core\Utility\ArrayUtility; /** * Container of all configurations for extension. diff --git a/Classes/Domain/Model/SearchRequest.php b/Classes/Domain/Model/SearchRequest.php index 3c88871..a375d24 100644 --- a/Classes/Domain/Model/SearchRequest.php +++ b/Classes/Domain/Model/SearchRequest.php @@ -93,7 +93,9 @@ class SearchRequest implements SearchRequestInterface public function setFilter(array $filter) { $filter = \TYPO3\CMS\Core\Utility\ArrayUtility::removeArrayEntryByValue($filter, ''); - $this->filter = \TYPO3\CMS\Extbase\Utility\ArrayUtility::removeEmptyElementsRecursively($filter); + $this->filter = \TYPO3\CMS\Core\Utility\ArrayUtility::filterRecursive($filter, function ($value) { + return !empty($value); + }); } public function hasFilter() : bool diff --git a/Classes/Domain/Search/QueryFactory.php b/Classes/Domain/Search/QueryFactory.php index 98e3324..a2f6c43 100644 --- a/Classes/Domain/Search/QueryFactory.php +++ b/Classes/Domain/Search/QueryFactory.php @@ -25,7 +25,7 @@ use Codappix\SearchCore\Configuration\ConfigurationUtility; use Codappix\SearchCore\Configuration\InvalidArgumentException; use Codappix\SearchCore\Connection\SearchRequestInterface; use TYPO3\CMS\Core\Utility\GeneralUtility; -use TYPO3\CMS\Extbase\Utility\ArrayUtility; +use TYPO3\CMS\Core\Utility\ArrayUtility; class QueryFactory { diff --git a/ext_localconf.php b/ext_localconf.php index 658d683..810b3eb 100644 --- a/ext_localconf.php +++ b/ext_localconf.php @@ -5,7 +5,7 @@ call_user_func( // TODO: Add hook for Extbase -> to handle records modified through // Frontend and backend modules not using datahandler - $GLOBALS['TYPO3_CONF_VARS'] = TYPO3\CMS\Extbase\Utility\ArrayUtility::arrayMergeRecursiveOverrule( + \TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule( $GLOBALS['TYPO3_CONF_VARS'], [ 'SC_OPTIONS' => [ @@ -43,7 +43,8 @@ call_user_func( \Codappix\SearchCore\Compatibility\ImplementationRegistrationService::registerImplementations(); // API does make use of object manager, therefore use GLOBALS - $extensionConfiguration = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][$extensionKey]); + $extensionConfiguration = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Configuration\ExtensionConfiguration::class)->get($extensionKey); + if ($extensionConfiguration === false || !isset($extensionConfiguration['disable.']['elasticsearch']) || $extensionConfiguration['disable.']['elasticsearch'] !== '1'