Commit aca2f9d6 authored by Tomáš Pospíšil's avatar Tomáš Pospíšil
Browse files

optimized dumping

parent 57a04ad8
<?php
/**
* @noinspection MissingParameterTypeDeclarationInspection
* @noinspection MissingReturnTypeInspection
* @noinspection ReturnTypeCanBeDeclaredInspection
* @noinspection MethodShouldBeFinalInspection
*/
declare(strict_types=1);
namespace Praguebest\Tools;
use Praguebest\BarPanel\Registrator;
use Praguebest\Tools\SmartyTrace\TraceableInternalTemplate;
use Smarty;
use Smarty_Internal_Template;
use SmartyException;
class TraceableSmarty extends Smarty
{
......@@ -20,24 +30,25 @@ class TraceableSmarty extends Smarty
/**
* TraceableSmarty constructor.
* @noinspection PhpFullyQualifiedNameUsageInspection
*/
public function __construct()
{
parent::__construct();
if (OnOffSwitcher::shouldProfile(TraceableSmarty::INTERNAL_VARIABLES)) {
if (OnOffSwitcher::shouldProfile(self::INTERNAL_VARIABLES)) {
$this->template_class = TraceableInternalTemplate::class;
$this->collectVariables = true;
}
if (class_exists(\noximo\Dbgr::class)) {
$this->templatesSys->registerClass('Dbgr', \noximo\Dbgr::class);
$this->registerClass('Dbgr', \noximo\Dbgr::class);
}
if (class_exists(\Nette\Utils\Strings::class)) {
$this->templatesSys->registerClass('Strings', \Nette\Utils\Strings::class);
$this->registerClass('Strings', \Nette\Utils\Strings::class);
}
$this->collectBacktraces = OnOffSwitcher::shouldProfile(TraceableSmarty::SMARTY_VARIABLES);
$this->collectBacktraces = OnOffSwitcher::shouldProfile(self::SMARTY_VARIABLES);
}
/**
......@@ -88,6 +99,7 @@ class TraceableSmarty extends Smarty
* @param object|null $parent
* @param bool $do_clone
* @return Smarty_Internal_Template
* @throws SmartyException
*/
public function createTemplate($template, $cache_id = null, $compile_id = null, $parent = null, $do_clone = true)
{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment