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

Fix WebSwitcherUrls in cli

parent f8787b53
......@@ -5,6 +5,11 @@ declare(strict_types=1);
namespace Praguebest\Tools;
use Smarty;
use Smarty_Internal_Runtime_Inheritance;
use Smarty_Internal_Template;
use Smarty_Internal_TemplateBase;
use Smarty_Template_Compiled;
use Smarty_Template_Resource_Base;
use Tracy\Helpers;
final class Dumper
......@@ -17,6 +22,11 @@ final class Dumper
'EPObject',
'EPModel',
'EPBase',
Smarty_Template_Compiled::class,
Smarty_Template_Resource_Base::class,
Smarty_Internal_Template::class,
Smarty_Internal_TemplateBase::class,
Smarty_Internal_Runtime_Inheritance::class,
self::class,
DBProfiler::class,
];
......
......@@ -28,9 +28,17 @@ final class WebSwitcherUrls
public function __construct(string $local, string $testing, string $live)
{
if (PHP_SAPI === 'cli') {
$this->local = 'cli';
$this->testing = 'cli';
$this->live = 'cli';
$this->current = 'cli';
return;
}
$current = $this->currentUrl();
$host = parse_url($current, PHP_URL_HOST);
$host = parse_url($current, PHP_URL_HOST) ?? '';
$normalized = Strings::replace(urldecode($current), '/' . preg_quote($host, '/') . '/', '%s', 1);
......
{if $countSmartyVariables === 0}
<span style="color: gray; text-decoration: line-through">{ldelim}${rdelim} Smarty variables</span>
<span class="tracy-label"></span>
<span style="color: gray; text-decoration: line-through">{ldelim}${rdelim}</span>
{else}
{strip}
<span style="color: coral">{ldelim}</span>
......
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