forked from erikdubbelboer/phpRedisAdmin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
info.php
60 lines (37 loc) · 1.06 KB
/
info.php
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
<?php
require_once 'includes/common.inc.php';
if (isset($_GET['reset']) && method_exists($redis, 'resetStat')) {
$redis->resetStat();
header('Location: info.php');
die;
}
// Fetch the info
$info = $redis->info();
$alt = false;
$page['css'][] = 'frame';
$page['js'][] = 'frame';
require 'includes/header.inc.php';
?>
<h2>Info</h2>
<?php if (method_exists($redis, 'resetStat')) { ?>
<p>
<a href="?reset&s=<?php echo $server['id']?>&d=<?php echo $server['db']?>" class="reset">Reset usage statistics</a>
</p>
<?php } ?>
<table>
<tr><th><div>Key</div></th><th><div>Value</div></th></tr>
<?php
foreach ($info as $key => $value) {
if ($key == 'allocation_stats') { // This key is very long to split it into multiple lines
$value = str_replace(',', ",\n", $value);
}
?>
<tr <?php echo $alt ? 'class="alt"' : ''?>><td><div><?php echo format_html($key)?></div></td><td><pre><?php echo format_html(is_array($value) ? print_r($value, true) : $value)?></pre></td></tr>
<?php
$alt = !$alt;
}
?>
</table>
<?php
require 'includes/footer.inc.php';
?>