Error.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <style type="text/css">
  2. .system_error {
  3. border:1px solid #990000;
  4. padding:10px 20px;
  5. margin:10px;
  6. font: 13px/1.4em verdana;
  7. background: #fff;
  8. }
  9. code.source {
  10. white-space: pre;
  11. background: #fff;
  12. padding: 1em;
  13. display: block;
  14. margin: 1em 0;
  15. border: 1px solid #bedbeb;
  16. }
  17. .system_error .box {
  18. margin: 1em 0;
  19. background: #ebf2fa;
  20. padding: 10px;
  21. border: 1px solid #bedbeb;
  22. }
  23. .code.source em { background: #ffc; }
  24. </style>
  25. <div class="system_error">
  26. <b style="color: #990000">Error</b>
  27. <p><?php echo $error; ?></p>
  28. <?php //print dump(debug_backtrace()); ?>
  29. <?php
  30. if($backtrace = \Micro\Error::backtrace(1))
  31. {
  32. foreach($backtrace as $id => $line)
  33. {
  34. print '<div class="box">';
  35. //Skip the first element
  36. if( $id !== 0 )
  37. {
  38. // If this is a class include the class name
  39. print '<b>Called by '. (isset($line['class']) ? $line['class']. $line['type'] : '');
  40. print $line['function']. '()</b>';
  41. }
  42. // Print file, line, and source
  43. print ' in '. $line['file']. ' ['. $line['line']. ']';
  44. print '<code class="source">'. $line['source']. '</code>';
  45. if(isset($line['args']))
  46. {
  47. print '<b>Function Arguments</b>';
  48. print dump($line['args']);
  49. }
  50. print '</div>';
  51. }
  52. }
  53. elseif(isset($file, $line))
  54. {
  55. print '<p><b>'. $file. '</b> ('. $line. ')</p>';
  56. }
  57. ?>
  58. </div>