remove unused Smarty collector
This commit is contained in:
parent
29940a97d1
commit
6534af14c3
@ -19,7 +19,6 @@ use D3\DebugBar\Application\Models\AvailabilityCheck;
|
|||||||
use D3\DebugBar\Application\Models\Collectors\OxidConfigCollector;
|
use D3\DebugBar\Application\Models\Collectors\OxidConfigCollector;
|
||||||
use D3\DebugBar\Application\Models\Collectors\OxidShopCollector;
|
use D3\DebugBar\Application\Models\Collectors\OxidShopCollector;
|
||||||
use D3\DebugBar\Application\Models\Collectors\OxidVersionCollector;
|
use D3\DebugBar\Application\Models\Collectors\OxidVersionCollector;
|
||||||
use D3\DebugBar\Application\Models\Collectors\SmartyCollector;
|
|
||||||
use D3\DebugBar\Application\Models\Collectors\TemplateVariablesCollector;
|
use D3\DebugBar\Application\Models\Collectors\TemplateVariablesCollector;
|
||||||
use D3\DebugBar\Application\Models\Exceptions\UnavailableException;
|
use D3\DebugBar\Application\Models\Exceptions\UnavailableException;
|
||||||
use D3\DebugBar\Application\Models\TimeDataCollectorHandler;
|
use D3\DebugBar\Application\Models\TimeDataCollectorHandler;
|
||||||
@ -109,15 +108,6 @@ class DebugBarComponent extends BaseController
|
|||||||
return new DoctrineCollector($debugStack);
|
return new DoctrineCollector($debugStack);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return SmartyCollector
|
|
||||||
*/
|
|
||||||
public function getSmartyCollector(): SmartyCollector
|
|
||||||
{
|
|
||||||
$smarty = Registry::getUtilsView()->getSmarty();
|
|
||||||
return new SmartyCollector($smarty);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return TemplateVariablesCollector
|
* @return TemplateVariablesCollector
|
||||||
* @throws ContainerExceptionInterface
|
* @throws ContainerExceptionInterface
|
||||||
|
@ -1,86 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 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) 2016 Dmitry Kosenkov
|
|
||||||
* @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;
|
|
||||||
use OxidEsales\Eshop\Core\Registry;
|
|
||||||
use Smarty;
|
|
||||||
|
|
||||||
class SmartyCollector extends DataCollector implements Renderable
|
|
||||||
{
|
|
||||||
/** @var Smarty */
|
|
||||||
protected $smarty;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param Smarty $smarty
|
|
||||||
*/
|
|
||||||
public function __construct(Smarty $smarty)
|
|
||||||
{
|
|
||||||
$this->smarty = $smarty;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return array
|
|
||||||
*/
|
|
||||||
public function collect(): array
|
|
||||||
{
|
|
||||||
$data = ['current view template' => Registry::getConfig()->getTopActiveView()->getTemplateName()];
|
|
||||||
|
|
||||||
$vars = $this->smarty->get_template_vars();
|
|
||||||
|
|
||||||
foreach ($vars as $idx => $var) {
|
|
||||||
if ($this->isHtmlVarDumperUsed()) {
|
|
||||||
$data[$idx] = $this->getVarDumper()->renderVar($var);
|
|
||||||
} else {
|
|
||||||
$data[$idx] = $this->getDataFormatter()->formatVar($var);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return ['vars' => $data, 'count' => count($data)];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function getName(): string
|
|
||||||
{
|
|
||||||
return 'smarty';
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return array
|
|
||||||
*/
|
|
||||||
public function getWidgets(): array
|
|
||||||
{
|
|
||||||
$widget = $this->isHtmlVarDumperUsed()
|
|
||||||
? "PhpDebugBar.Widgets.HtmlVariableListWidget"
|
|
||||||
: "PhpDebugBar.Widgets.VariableListWidget";
|
|
||||||
return [
|
|
||||||
"smarty" => [
|
|
||||||
"icon" => "file-text",
|
|
||||||
"widget" => $widget,
|
|
||||||
"map" => "smarty.vars",
|
|
||||||
"default" => "{}",
|
|
||||||
],
|
|
||||||
"smarty:badge" => [
|
|
||||||
"map" => "smarty.count",
|
|
||||||
"default" => 0,
|
|
||||||
],
|
|
||||||
];
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user