Welcome to mirror list, hosted at ThFree Co, Russian Federation.

info.php - github.com/erikdubbelboer/phpRedisAdmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 77c6a3db9e20d3d3f6317d1b5fde28d372fb1916 (plain)
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
<?php

require_once 'includes/common.inc.php';
global $redis, $config, $csrfToken, $server;

if (isset($_GET['reset'])) {
  $redis->config('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>

<p>
<a href="?reset=1&amp;s=<?php echo $server['id']?>&amp;d=<?php echo $server['db']?>" class="reset">Reset usage statistics</a>
</p>

<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';

?>