Skip to content

Commit c14cd30

Browse files
committed
SessionPanel: compatibility with Tracy 2.5
1 parent e1e49d9 commit c14cd30

1 file changed

Lines changed: 19 additions & 27 deletions

File tree

src/Bridges/HttpTracy/templates/SessionPanel.panel.phtml

Lines changed: 19 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -7,39 +7,31 @@ use Tracy\Dumper;
77

88
?>
99
<style class="tracy-debug">
10-
11-
#tracy-debug .nette-SessionPanel .tracy-inner table {
12-
width: 100%;
13-
}
14-
1510
#tracy-debug .nette-SessionPanel-parameters pre {
1611
background: #FDF5CE;
1712
padding: .4em .7em;
1813
border: 1px dotted silver;
1914
overflow: auto;
2015
}
21-
2216
</style>
2317

24-
<div class="nette-SessionPanel">
25-
<h1>Session #<?= htmlspecialchars(session_id(), ENT_IGNORE, 'UTF-8') ?> (Lifetime: <?= htmlspecialchars(ini_get('session.cookie_lifetime'), ENT_NOQUOTES, 'UTF-8'); ?>)</h1>
26-
27-
<div class="tracy-inner">
28-
<?php if (empty($_SESSION)):?>
29-
<p><i>empty</i></p>
30-
<?php else: ?>
31-
<table>
32-
<?php
33-
foreach ($_SESSION as $k => $v) {
34-
if ($k === '__NF') {
35-
$k = 'Nette Session';
36-
$v = $v['DATA'] ?? null;
37-
} elseif ($k === '_tracy') {
38-
continue;
39-
}
40-
echo '<tr><th>', htmlspecialchars((string) $k, ENT_IGNORE, 'UTF-8'), '</th><td>', Dumper::toHtml($v, [Dumper::LIVE => true]), "</td></tr>\n";
41-
}?>
42-
</table>
43-
<?php endif ?>
44-
</div>
18+
<h1>Session #<?= htmlspecialchars(session_id(), ENT_IGNORE, 'UTF-8') ?> (Lifetime: <?= htmlspecialchars(ini_get('session.cookie_lifetime'), ENT_NOQUOTES, 'UTF-8'); ?>)</h1>
19+
20+
<div class="tracy-inner nette-SessionPanel">
21+
<?php if (empty($_SESSION)):?>
22+
<p><i>empty</i></p>
23+
<?php else: ?>
24+
<table>
25+
<?php
26+
foreach ($_SESSION as $k => $v) {
27+
if ($k === '__NF') {
28+
$k = 'Nette Session';
29+
$v = $v['DATA'] ?? null;
30+
} elseif ($k === '_tracy') {
31+
continue;
32+
}
33+
echo '<tr><th>', htmlspecialchars((string) $k, ENT_IGNORE, 'UTF-8'), '</th><td>', Dumper::toHtml($v, [Dumper::LIVE => true]), "</td></tr>\n";
34+
}?>
35+
</table>
36+
<?php endif ?>
4537
</div>

0 commit comments

Comments
 (0)