DebugBar/Application/Models/Collectors/OxidVersionCollector.php

65 lines
1.4 KiB
PHP
Raw Normal View History

2022-08-04 16:03:32 +02:00
<?php
2022-08-16 11:08:53 +02:00
2022-08-04 16:03:32 +02:00
/**
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* https://www.d3data.de
*
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
* @author D3 Data Development - Daniel Seifert <info@shopmodule.com>
* @link https://www.oxidmodule.com
*/
declare(strict_types=1);
namespace D3\DebugBar\Application\Models\Collectors;
use DebugBar\DataCollector\DataCollector;
use DebugBar\DataCollector\Renderable;
2022-08-16 11:08:53 +02:00
use Exception;
2022-08-04 16:03:32 +02:00
use OxidEsales\Eshop\Core\ShopVersion;
use OxidEsales\Facts\Facts;
/**
* Collects info about OXID shop
*/
class OxidVersionCollector extends DataCollector implements Renderable
{
/**
* @return string
*/
2022-08-16 11:08:53 +02:00
public function getName(): string
2022-08-04 16:03:32 +02:00
{
return 'oxidversion';
}
/**
* @return array
2022-08-16 11:08:53 +02:00
* @throws Exception
2022-08-04 16:03:32 +02:00
*/
2022-08-16 11:08:53 +02:00
public function collect(): array
2022-08-04 16:03:32 +02:00
{
$facts = new Facts();
2022-08-16 11:08:53 +02:00
return [
'version' => $facts->getEdition().' '.ShopVersion::getVersion(),
];
2022-08-04 16:03:32 +02:00
}
/**
2022-08-16 11:08:53 +02:00
* @return string[][]
2022-08-04 16:03:32 +02:00
*/
2022-08-16 11:08:53 +02:00
public function getWidgets(): array
2022-08-04 16:03:32 +02:00
{
return [
"oxidversion" => [
"icon" => "shopping-cart",
"tooltip" => 'OXID Version',
"map" => $this->getName().".version",
2022-08-16 11:08:53 +02:00
"default" => "",
2022-08-04 16:03:32 +02:00
],
];
}
}