info.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php
  2. require_once 'includes/common.inc.php';
  3. if (isset($_GET['reset']) && method_exists($redis, 'resetStat')) {
  4. $redis->resetStat();
  5. header('Location: info.php');
  6. die;
  7. }
  8. // Fetch the info
  9. $info = $redis->Info_hash();
  10. $alt = false;
  11. $page['css'][] = 'frame';
  12. $page['js'][] = 'frame';
  13. require 'includes/header.inc.php';
  14. ?>
  15. <h2>Info</h2>
  16. <?php if (method_exists($redis, 'resetStat')) { ?>
  17. <p>
  18. <a href="?reset&amp;s=<?php echo $server['id']?>&amp;d=<?php echo $server['db']?>" class="reset">Reset usage statistics</a>
  19. </p>
  20. <?php } ?>
  21. <table>
  22. <tr><th><div>Key</div></th><th><div>Value</div></th></tr>
  23. <?php
  24. foreach ($info as $key => $value) {
  25. if ($key == 'allocation_stats') { // This key is very long to split it into multiple lines
  26. $value = str_replace(',', ",\n", $value);
  27. }
  28. ?>
  29. <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>
  30. <?php
  31. $alt = !$alt;
  32. }
  33. ?>
  34. </table>
  35. <?php
  36. require 'includes/footer.inc.php';
  37. ?>