Skip to content

Commit

Permalink
Merge branch 'main' into update-for-v12
Browse files Browse the repository at this point in the history
  • Loading branch information
runepiper authored May 7, 2024
2 parents baffef8 + abdaa05 commit 4dd726c
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
26 changes: 26 additions & 0 deletions Classes/EventListener/AddVersionToSystemInformationToolbar.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

namespace VV\T3meilisearch\EventListener;

use MeiliSearch\Client;
use TYPO3\CMS\Backend\Backend\Event\SystemInformationToolbarCollectorEvent;
use TYPO3\CMS\Backend\Toolbar\Enumeration\InformationStatus;
use TYPO3\CMS\Core\Configuration\ExtensionConfiguration;
use TYPO3\CMS\Core\Utility\GeneralUtility;

class AddVersionToSystemInformationToolbar
{
public function __invoke(SystemInformationToolbarCollectorEvent $event): void
{
$settings = GeneralUtility::makeInstance(ExtensionConfiguration::class)->get('t3meilisearch');
$client = new Client($settings['host'], $settings['apiKey']);
$version = $client->version()['pkgVersion'];

$event->getToolbarItem()->addSystemInformation(
'Meilisearch Version',
$version,
'actions-search',
InformationStatus::STATUS_NOTICE
);
}
}
4 changes: 4 additions & 0 deletions Configuration/Services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,7 @@ services:
VV\T3meilisearch\EventListener\IndexContent:
tags:
- name: event.listener

VV\T3meilisearch\EventListener\AddVersionToSystemInformationToolbar:
tags:
- name: event.listener

0 comments on commit 4dd726c

Please sign in to comment.