Core.class.php 920 B

1234567891011121314151617181920212223
  1. <?php
  2. /**
  3. *
  4. */
  5. class Core
  6. {
  7. /**
  8. * 报错方法
  9. * @param string $msg [description]
  10. */
  11. public static function error($msg = '')
  12. {
  13. header('Content-Type: text/html; charset=utf-8');
  14. if (IS_DEBUG) {
  15. $msg = $msg ?: '出错了!';
  16. die('Message:' . $msg);
  17. } else {
  18. echo '<!DOCTYPE html><html><head><title>Laravel</title><style>html, body {height: 100%;}body {margin: 0;padding: 0;width: 100%;display: table;font-weight: 100;}.container {text-align: center;display: table-cell;vertical-align: middle;}.content {text-align: center;display: inline-block;}.title {font-size: 96px;}</style></head><body><div class="container"><div class="content"><div class="title">404!页面找不到哦,2s后返回上一页</div></div></div><script>window.setTimeout("history.back(-1)",2000); </script></body></html>';
  19. die;
  20. }
  21. }
  22. }