Skip to content

Commit 38da0eb

Browse files
committed
SessionPanel: compatibility with Tracy 2.5
1 parent 0c979de commit 38da0eb

File tree

1 file changed

+19
-27
lines changed

1 file changed

+19
-27
lines changed

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

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

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

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

0 commit comments

Comments
 (0)