File: SessionPanel.panel.phtml

package info (click to toggle)
php-nette 2.4-20160731-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 3,208 kB
  • ctags: 7,552
  • sloc: php: 31,410; makefile: 6
file content (31 lines) | stat: -rw-r--r-- 988 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php

namespace Nette\Bridges\HttpTracy;

use Nette,
	Tracy\Dumper;

?>
<style class="tracy-debug">#tracy-debug .nette-SessionPanel .tracy-inner table{width:100%}#tracy-debug .nette-SessionPanel-parameters pre{background:#FDF5CE;padding:.4em .7em;border:1px dotted silver;overflow:auto}</style>

<div class="nette-SessionPanel">
	<h1>Session #<?= htmlspecialchars(session_id(), ENT_IGNORE, 'UTF-8') ?> (Lifetime: <?= htmlspecialchars(ini_get('session.cookie_lifetime'), ENT_NOQUOTES, 'UTF-8'); ?>)</h1>

	<div class="tracy-inner">
		<?php if (empty($_SESSION)):?>
		<p><i>empty</i></p>
		<?php else: ?>
		<table>
		<?php
		foreach ($_SESSION as $k => $v) {
			if ($k === '__NF') {
				$k = 'Nette Session'; $v = isset($v['DATA']) ? $v['DATA'] : NULL;
			} elseif ($k === '_tracy') {
				continue;
			}
			echo '<tr><th>', htmlspecialchars($k, ENT_IGNORE, 'UTF-8'), '</th><td>', Dumper::toHtml($v, [Dumper::LIVE => TRUE]), "</td></tr>\n";
		}?>
		</table>
		<?php endif ?>
	</div>
</div>