-
Notifications
You must be signed in to change notification settings - Fork 7
/
debug.inc
84 lines (73 loc) · 1.83 KB
/
debug.inc
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<div id="debug">
<div class="container">
<h3><a href='#'>Pages Loaded</a></h3>
<div>
<ul>
<?php
foreach($pages->getCache() as $p) {
echo "\n<li>" . $p->url . "</li>";
}
?>
</ul>
</div>
</div>
<div class="container">
<h3><a href='#'>Session</a></h3>
<div><?php print_r($_SESSION); ?></div>
</div>
<div class="container">
<h3><a href='#'>Modules Loaded</a></h3>
<div>
<ol>
<?php foreach($modules as $module) if(!$module instanceof ModulePlaceholder) echo "\n<li>" . $module->className() . ": " . get_class($module) . "</li>"; ?>
</ol>
</div>
</div>
<div class="container">
<h3><a href='#'>Queries</a></h3>
<div>
<ol>
<?php foreach($db->getQueryLog() as $n => $sql) echo "\n<li>$n. $sql</li>"; ?>
</ol>
</div>
</div>
<div class="container">
<h3><a href='#'>Fuel</a></h3>
<div>
<ol>
<?php foreach($fuel as $key => $value) echo "\n<li>$key</li>"; ?>
</ol>
</div>
</div>
<div class="container">
<h3><a href='#'>User (<?php echo $user->name;?>)</a></h3>
<div>
<h4>Current User's Roles</h4>
<ol>
<?php foreach($user->roles as $role) echo "\n<li>{$role->name}</li>"; ?>
</ol>
<h4>Current User's Permissions</h4>
<ol>
<?php foreach($user->getPermissions() as $permission) echo "\n<li>{$permission->name}</li>"; ?>
</ol>
<h4>Current User's Permissions on this page</h4>
<ol>
<?php foreach($user->getPermissions($page) as $permission) echo "\n<li>{$permission->name}</li>"; ?>
</ol>
</div>
</div>
<div class="container">
<h3><a href='#'>$_POST</a></h3>
<pre>
<?php echo htmlspecialchars(print_r($_POST, true)); ?>
</pre>
</div>
</div>
<script type="text/javascript">
$(document).ready(function() {
$("#debug").accordion({
header: 'h3',
autoHeight: false
});
});
</script>