From d0f4ac3b75ad9d9e622bd8209ddadc76c3d94ba7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20K=C3=A4hm?= Date: Tue, 13 Jun 2023 16:54:28 +0200 Subject: [PATCH] [TASK:T12] simplify FQDNs in ext_localconf.php Relates: #3376 --- ext_localconf.php | 110 ++++++++++++++++++++++++++-------------------- 1 file changed, 63 insertions(+), 47 deletions(-) diff --git a/ext_localconf.php b/ext_localconf.php index 0e680ba2fc..242b911648 100644 --- a/ext_localconf.php +++ b/ext_localconf.php @@ -1,12 +1,37 @@ 'solr', 'title' => 'LLL:EXT:solr/Resources/Private/Language/locallang.xlf:optimizeindex_title', 'description' => 'LLL:EXT:solr/Resources/Private/Language/locallang.xlf:optimizeindex_description', - 'additionalFields' => \ApacheSolrForTypo3\Solr\Task\OptimizeIndexTaskAdditionalFieldProvider::class, + 'additionalFields' => OptimizeIndexTaskAdditionalFieldProvider::class, ]; - $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][\ApacheSolrForTypo3\Solr\Task\ReIndexTask::class] = [ + $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][ReIndexTask::class] = [ 'extension' => 'solr', 'title' => 'LLL:EXT:solr/Resources/Private/Language/locallang.xlf:reindex_title', 'description' => 'LLL:EXT:solr/Resources/Private/Language/locallang.xlf:reindex_description', - 'additionalFields' => \ApacheSolrForTypo3\Solr\Task\ReIndexTaskAdditionalFieldProvider::class, + 'additionalFields' => ReIndexTaskAdditionalFieldProvider::class, ]; - $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][\ApacheSolrForTypo3\Solr\Task\IndexQueueWorkerTask::class] = [ + $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][IndexQueueWorkerTask::class] = [ 'extension' => 'solr', 'title' => 'LLL:EXT:solr/Resources/Private/Language/locallang.xlf:indexqueueworker_title', 'description' => 'LLL:EXT:solr/Resources/Private/Language/locallang.xlf:indexqueueworker_description', - 'additionalFields' => \ApacheSolrForTypo3\Solr\Task\IndexQueueWorkerTaskAdditionalFieldProvider::class, + 'additionalFields' => IndexQueueWorkerTaskAdditionalFieldProvider::class, ]; - $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][\ApacheSolrForTypo3\Solr\Task\EventQueueWorkerTask::class] = [ + $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][EventQueueWorkerTask::class] = [ 'extension' => 'solr', 'title' => 'LLL:EXT:solr/Resources/Private/Language/locallang_be.xlf:task.eventQueueWorkerTask.title', 'description' => 'LLL:EXT:solr/Resources/Private/Language/locallang_be.xlf:task.eventQueueWorkerTask.description', - 'additionalFields' => \ApacheSolrForTypo3\Solr\Task\EventQueueWorkerTaskAdditionalFieldProvider::class, + 'additionalFields' => EventQueueWorkerTaskAdditionalFieldProvider::class, ]; - if (!isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][\TYPO3\CMS\Scheduler\Task\TableGarbageCollectionTask::class]['options']['tables']['tx_solr_statistics'])) { - $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][\TYPO3\CMS\Scheduler\Task\TableGarbageCollectionTask::class]['options']['tables']['tx_solr_statistics'] = [ + if (!isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][TableGarbageCollectionTask::class]['options']['tables']['tx_solr_statistics'])) { + $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][TableGarbageCollectionTask::class]['options']['tables']['tx_solr_statistics'] = [ 'dateField' => 'tstamp', 'expirePeriod' => 180, ]; @@ -79,7 +98,7 @@ // registering the eID scripts // TODO move to suggest form modifier - $GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include']['tx_solr_api'] = \ApacheSolrForTypo3\Solr\Eid\ApiEid::class . '::main'; + $GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include']['tx_solr_api'] = ApiEid::class . '::main'; // ----- # ----- # ----- # ----- # ----- # ----- # ----- # ----- # ----- # @@ -94,11 +113,11 @@ } if (!isset($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['tx_solr_configuration']['backend'])) { - $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['tx_solr_configuration']['backend'] = \TYPO3\CMS\Core\Cache\Backend\Typo3DatabaseBackend::class; + $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['tx_solr_configuration']['backend'] = Typo3DatabaseBackend::class; } if (!isset($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['tx_solr_configuration']['options'])) { - // default life time one day + // default life-time is one day $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['tx_solr_configuration']['options'] = ['defaultLifetime' => 60 * 60 * 24]; } @@ -107,13 +126,11 @@ } // ----- # ----- # ----- # ----- # ----- # ----- # ----- # ----- # ----- # - /** @var \ApacheSolrForTypo3\Solr\System\Configuration\ExtensionConfiguration $extensionConfiguration */ - $extensionConfiguration = GeneralUtility::makeInstance( - \ApacheSolrForTypo3\Solr\System\Configuration\ExtensionConfiguration::class - ); + /** @var ExtensionConfiguration $extensionConfiguration */ + $extensionConfiguration = GeneralUtility::makeInstance(ExtensionConfiguration::class); // cacheHash handling - \TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule( + ArrayUtility::mergeRecursiveWithOverrule( $GLOBALS['TYPO3_CONF_VARS'], [ 'FE' => [ @@ -127,25 +144,25 @@ // ----- # ----- # ----- # ----- # ----- # ----- # ----- # ----- # ----- # if (!isset($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['solr']['searchResultClassName '])) { - $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['solr']['searchResultClassName '] = \ApacheSolrForTypo3\Solr\Domain\Search\ResultSet\Result\SearchResult::class; + $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['solr']['searchResultClassName '] = SearchResult::class; } if (!isset($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['solr']['searchResultSetClassName '])) { - $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['solr']['searchResultSetClassName '] = \ApacheSolrForTypo3\Solr\Domain\Search\ResultSet\SearchResultSet::class; + $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['solr']['searchResultSetClassName '] = SearchResultSet::class; } if (!isset($GLOBALS['TYPO3_CONF_VARS']['LOG']['ApacheSolrForTypo3']['Solr']['writerConfiguration'])) { - $context = \TYPO3\CMS\Core\Core\Environment::getContext(); + $context = Environment::getContext(); if ($context->isProduction()) { - $logLevel = \TYPO3\CMS\Core\Log\LogLevel::ERROR; + $logLevel = LogLevel::ERROR; } elseif ($context->isDevelopment()) { - $logLevel = \TYPO3\CMS\Core\Log\LogLevel::DEBUG; + $logLevel = LogLevel::DEBUG; } else { - $logLevel = \TYPO3\CMS\Core\Log\LogLevel::INFO; + $logLevel = LogLevel::INFO; } $GLOBALS['TYPO3_CONF_VARS']['LOG']['ApacheSolrForTypo3']['Solr']['writerConfiguration'] = [ $logLevel => [ - \TYPO3\CMS\Core\Log\Writer\FileWriter::class => [ + FileWriter::class => [ 'logFileInfix' => 'solr', ], ], @@ -154,44 +171,44 @@ // ----- # ----- # ----- # ----- # ----- # ----- # ----- # ----- # ----- # - \TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin( + ExtensionUtility::configurePlugin( 'Solr', 'pi_results', [ - \ApacheSolrForTypo3\Solr\Controller\SearchController::class => 'results,form,detail', + SearchController::class => 'results,form,detail', ], [ - \ApacheSolrForTypo3\Solr\Controller\SearchController::class => 'results', + SearchController::class => 'results', ] ); - \TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin( + ExtensionUtility::configurePlugin( 'Solr', 'pi_search', [ - \ApacheSolrForTypo3\Solr\Controller\SearchController::class => 'form', + SearchController::class => 'form', ] ); - \TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin( + ExtensionUtility::configurePlugin( 'Solr', 'pi_frequentlySearched', [ - \ApacheSolrForTypo3\Solr\Controller\SearchController::class => 'frequentlySearched', + SearchController::class => 'frequentlySearched', ], [ - \ApacheSolrForTypo3\Solr\Controller\SearchController::class => 'frequentlySearched', + SearchController::class => 'frequentlySearched', ] ); - \TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin( + ExtensionUtility::configurePlugin( 'Solr', 'pi_suggest', [ - \ApacheSolrForTypo3\Solr\Controller\SuggestController::class => 'suggest', + SuggestController::class => 'suggest', ], [ - \ApacheSolrForTypo3\Solr\Controller\SuggestController::class => 'suggest', + SuggestController::class => 'suggest', ] ); @@ -201,8 +218,7 @@ /* * Solr route enhancer configuration */ - $GLOBALS['TYPO3_CONF_VARS']['SYS']['routing']['enhancers']['SolrFacetMaskAndCombineEnhancer'] = - \ApacheSolrForTypo3\Solr\Routing\Enhancer\SolrFacetMaskAndCombineEnhancer::class; + $GLOBALS['TYPO3_CONF_VARS']['SYS']['routing']['enhancers']['SolrFacetMaskAndCombineEnhancer'] = SolrFacetMaskAndCombineEnhancer::class; // add solr field to rootline fields if ($GLOBALS['TYPO3_CONF_VARS']['FE']['addRootLineFields'] === '') { @@ -245,6 +261,6 @@ $isComposerMode = defined('TYPO3_COMPOSER_MODE') && TYPO3_COMPOSER_MODE; if (!$isComposerMode) { // we load the autoloader for our libraries - $dir = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('solr'); + $dir = ExtensionManagementUtility::extPath('solr'); require $dir . '/Resources/Private/Php/ComposerLibraries/vendor/autoload.php'; }