debug_panel.php 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. if( !defined("HESTIA_DIR_BIN") ){
  3. die("Direct access disabled");
  4. }
  5. ?>
  6. <div x-data="{ open: false }" class="debug-panel">
  7. <button
  8. type="button"
  9. class="debug-panel-toggle"
  10. x-on:click="open = !open"
  11. x-text="open ? '<?= _("Close debug panel") ?>' : '<?= _("Open debug panel") ?>'">
  12. <?= _("Open debug panel") ?>
  13. </button>
  14. <div x-cloak x-show="open" class="debug-panel-content animate__animated animate__fadeIn">
  15. <?php
  16. echo "<h3 class=\"u-mb10\">Server Variables</h3>";
  17. foreach ($_SERVER as $key => $val) {
  18. if(is_string($val)){
  19. echo "<span class=\"u-text-bold\">" . $key . "= </span> " . $val . " ";
  20. }
  21. }
  22. ?>
  23. <?php
  24. echo "<h3 class=\"u-mb10 u-mt10\">Session Variables</h3>";
  25. foreach ($_SESSION as $key => $val) {
  26. if(is_string($val)){
  27. echo "<span class=\"u-text-bold\">" . $key . "= </span> " . $val . " ";
  28. }else if(is_array($val)){
  29. array_walk_recursive($val, function (&$value) {
  30. $value = htmlentities($value);
  31. });
  32. echo "<span class=\"u-text-bold\">" . $key . "= </span> " .var_dump($val). " ";
  33. }
  34. }
  35. ?>
  36. <?php
  37. echo "<h3 class=\"u-mb10 u-mt10\">POST Variables</h3>";
  38. foreach ($_POST as $key => $val) {
  39. if(is_string($val)){
  40. echo "<span class=\"u-text-bold\">" . $key . "= </span> " . $val . " ";
  41. }else if(is_array($val)){
  42. array_walk_recursive($val, function (&$value) {
  43. $value = htmlentities($value);
  44. });
  45. echo "<span class=\"u-text-bold\">" . $key . "= </span> " .var_dump($val). " ";
  46. }
  47. }
  48. ?>
  49. <?php
  50. echo "<h3 class=\"u-mb10 u-mt10\">GET Variables</h3>";
  51. foreach ($_GET as $key => $val) {
  52. if(is_string($val)){
  53. echo "<span class=\"u-text-bold\">" . $key . "= </span> " . $val . " ";
  54. }else if(is_array($val)){
  55. array_walk_recursive($val, function (&$value) {
  56. $value = htmlentities($value);
  57. });
  58. echo "<span class=\"u-text-bold\">" . $key . "= </span> " .var_dump($val). " ";
  59. }
  60. }
  61. ?>
  62. </div>
  63. </div>