first commit

This commit is contained in:
Sven Wappler
2021-04-17 21:20:54 +02:00
parent c93ec9492a
commit cadcc8edb4
406 changed files with 4917 additions and 5157 deletions

View File

@@ -33,7 +33,7 @@ use WapplerSystems\Meilisearch\Domain\Index\Queue\Statistic\QueueStatisticsRepos
use WapplerSystems\Meilisearch\Domain\Site\Site;
use WapplerSystems\Meilisearch\FrontendEnvironment;
use WapplerSystems\Meilisearch\System\Cache\TwoLevelCache;
use WapplerSystems\Meilisearch\System\Logging\SolrLogManager;
use WapplerSystems\Meilisearch\System\Logging\MeilisearchLogManager;
use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
@@ -56,7 +56,7 @@ class Queue
protected $recordService;
/**
* @var \WapplerSystems\Meilisearch\System\Logging\SolrLogManager
* @var \WapplerSystems\Meilisearch\System\Logging\MeilisearchLogManager
*/
protected $logger = null;
@@ -97,7 +97,7 @@ class Queue
FrontendEnvironment $frontendEnvironment = null
)
{
$this->logger = GeneralUtility::makeInstance(SolrLogManager::class, /** @scrutinizer ignore-type */ __CLASS__);
$this->logger = GeneralUtility::makeInstance(MeilisearchLogManager::class, /** @scrutinizer ignore-type */ __CLASS__);
$this->rootPageResolver = $rootPageResolver ?? GeneralUtility::makeInstance(RootPageResolver::class);
$this->recordService = $recordService ?? GeneralUtility::makeInstance(ConfigurationAwareRecordService::class);
$this->queueItemRepository = $queueItemRepository ?? GeneralUtility::makeInstance(QueueItemRepository::class);
@@ -159,7 +159,7 @@ class Queue
/**
* Marks an item as needing (re)indexing.
*
* Like with Solr itself, there's no add method, just a simple update method
* Like with Meilisearch itself, there's no add method, just a simple update method
* that handles the adds, too.
*
* The method creates or updates the index queue items for all related rootPageIds.
@@ -195,8 +195,8 @@ class Queue
continue;
}
$solrConfiguration = $this->frontendEnvironment->getSolrConfigurationFromPageId($rootPageId);
$indexingConfiguration = $this->recordService->getIndexingConfigurationName($itemType, $itemUid, $solrConfiguration);
$meilisearchConfiguration = $this->frontendEnvironment->getMeilisearchConfigurationFromPageId($rootPageId);
$indexingConfiguration = $this->recordService->getIndexingConfigurationName($itemType, $itemUid, $meilisearchConfiguration);
if ($indexingConfiguration === null) {
continue;
}
@@ -227,11 +227,11 @@ class Queue
*/
protected function postProcessIndexQueueUpdateItem($itemType, $itemUid, $updateCount, $forcedChangeTime = 0)
{
if (!is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['solr']['postProcessIndexQueueUpdateItem'])) {
if (!is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['meilisearch']['postProcessIndexQueueUpdateItem'])) {
return $updateCount;
}
foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['solr']['postProcessIndexQueueUpdateItem'] as $classReference) {
foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['meilisearch']['postProcessIndexQueueUpdateItem'] as $classReference) {
$updateHandler = $this->getHookImplementation($classReference);
$updateCount = $updateHandler->postProcessIndexQueueUpdateItem($itemType, $itemUid, $updateCount, $forcedChangeTime);
}
@@ -568,7 +568,7 @@ class Queue
*
* @param Site $site TYPO3 site
* @param int $limit Number of items to get from the queue
* @return Item[] Items to index to the given solr server
* @return Item[] Items to index to the given meilisearch server
*/
public function getItemsToIndex(Site $site, $limit = 50)
{