exception.php 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  1. <!DOCTYPE html PUBLIC
  2. "-//W3C//DTD XHTML 1.0 Transitional//EN"
  3. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  4. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  5. <head>
  6. <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  7. <title><?php echo $data['type']; ?></title>
  8. <style type="text/css">
  9. /*<![CDATA[*/
  10. html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,font,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td{border:0;outline:0;font-size:100%;vertical-align:baseline;background:transparent;margin:0;padding:0;}
  11. body{line-height:1;}
  12. ol,ul{list-style:none;}
  13. blockquote,q{quotes:none;}
  14. blockquote:before,blockquote:after,q:before,q:after{content:none;}
  15. :focus{outline:0;}
  16. ins{text-decoration:none;}
  17. del{text-decoration:line-through;}
  18. table{border-collapse:collapse;border-spacing:0;}
  19. body {
  20. font: normal 9pt "Verdana";
  21. color: #000;
  22. background: #fff;
  23. }
  24. h1 {
  25. font: normal 18pt "Verdana";
  26. color: #f00;
  27. margin-bottom: .5em;
  28. }
  29. h2 {
  30. font: normal 14pt "Verdana";
  31. color: #800000;
  32. margin-bottom: .5em;
  33. }
  34. h3 {
  35. font: bold 11pt "Verdana";
  36. }
  37. pre {
  38. font: normal 11pt Menlo, Consolas, "Lucida Console", Monospace;
  39. }
  40. pre span.error {
  41. display: block;
  42. background: #fce3e3;
  43. }
  44. pre span.ln {
  45. color: #999;
  46. padding-right: 0.5em;
  47. border-right: 1px solid #ccc;
  48. }
  49. pre span.error-ln {
  50. font-weight: bold;
  51. }
  52. .container {
  53. margin: 1em 4em;
  54. }
  55. .version {
  56. color: gray;
  57. font-size: 8pt;
  58. border-top: 1px solid #aaa;
  59. padding-top: 1em;
  60. margin-bottom: 1em;
  61. }
  62. .message {
  63. color: #000;
  64. padding: 1em;
  65. font-size: 11pt;
  66. background: #f3f3f3;
  67. -webkit-border-radius: 10px;
  68. -moz-border-radius: 10px;
  69. border-radius: 10px;
  70. margin-bottom: 1em;
  71. line-height: 160%;
  72. }
  73. .source {
  74. margin-bottom: 1em;
  75. }
  76. .code pre {
  77. background-color: #ffe;
  78. margin: 0.5em 0;
  79. padding: 0.5em;
  80. line-height: 125%;
  81. border: 1px solid #eee;
  82. }
  83. .source .file {
  84. margin-bottom: 1em;
  85. font-weight: bold;
  86. }
  87. .traces {
  88. margin: 2em 0;
  89. }
  90. .trace {
  91. margin: 0.5em 0;
  92. padding: 0.5em;
  93. }
  94. .trace.app {
  95. border: 1px dashed #c00;
  96. }
  97. .trace .number {
  98. text-align: right;
  99. width: 2em;
  100. padding: 0.5em;
  101. }
  102. .trace .content {
  103. padding: 0.5em;
  104. }
  105. .trace .plus,
  106. .trace .minus {
  107. display:inline;
  108. vertical-align:middle;
  109. text-align:center;
  110. border:1px solid #000;
  111. color:#000;
  112. font-size:10px;
  113. line-height:10px;
  114. margin:0;
  115. padding:0 1px;
  116. width:10px;
  117. height:10px;
  118. }
  119. .trace.collapsed .minus,
  120. .trace.expanded .plus,
  121. .trace.collapsed pre {
  122. display: none;
  123. }
  124. .trace-file {
  125. cursor: pointer;
  126. padding: 0.2em;
  127. }
  128. .trace-file:hover {
  129. background: #f0ffff;
  130. }
  131. /*]]>*/
  132. </style>
  133. </head>
  134. <body>
  135. <div class="container">
  136. <h1><?php echo $data['type']?></h1>
  137. <p class="message">
  138. <?php echo nl2br(htmlspecialchars($data['message'],ENT_QUOTES,Yii::app()->charset))?>
  139. </p>
  140. <div class="source">
  141. <p class="file"><?php echo htmlspecialchars($data['file'],ENT_QUOTES,Yii::app()->charset)."({$data['line']})"?></p>
  142. <?php echo $this->renderSourceCode($data['file'],$data['line'],$this->maxSourceLines); ?>
  143. </div>
  144. <div class="traces">
  145. <h2>Stack Trace</h2>
  146. <?php $count=0; ?>
  147. <table style="width:100%;">
  148. <?php foreach($data['traces'] as $n => $trace): ?>
  149. <?php
  150. if($this->isCoreCode($trace))
  151. $cssClass='core collapsed';
  152. elseif(++$count>3)
  153. $cssClass='app collapsed';
  154. else
  155. $cssClass='app expanded';
  156. $hasCode=$trace['file']!=='unknown' && is_file($trace['file']);
  157. ?>
  158. <tr class="trace <?php echo $cssClass; ?>">
  159. <td class="number">
  160. #<?php echo $n; ?>
  161. </td>
  162. <td class="content">
  163. <div class="trace-file">
  164. <?php if($hasCode): ?>
  165. <div class="plus">+</div>
  166. <div class="minus">–</div>
  167. <?php endif; ?>
  168. <?php
  169. echo '&nbsp;';
  170. echo htmlspecialchars($trace['file'],ENT_QUOTES,Yii::app()->charset)."(".$trace['line'].")";
  171. echo ': ';
  172. if(!empty($trace['class']))
  173. echo "<strong>{$trace['class']}</strong>{$trace['type']}";
  174. echo "<strong>{$trace['function']}</strong>(";
  175. if(!empty($trace['args']))
  176. echo htmlspecialchars($this->argumentsToString($trace['args']),ENT_QUOTES,Yii::app()->charset);
  177. echo ')';
  178. ?>
  179. </div>
  180. <?php if($hasCode) echo $this->renderSourceCode($trace['file'],$trace['line'],$this->maxTraceSourceLines); ?>
  181. </td>
  182. </tr>
  183. <?php endforeach; ?>
  184. </table>
  185. </div>
  186. <div class="version">
  187. <?php echo date('Y-m-d H:i:s',$data['time']) .' '. $data['version']; ?>
  188. </div>
  189. </div>
  190. <script type="text/javascript">
  191. /*<![CDATA[*/
  192. var traceReg = new RegExp("(^|\\s)trace-file(\\s|$)");
  193. var collapsedReg = new RegExp("(^|\\s)collapsed(\\s|$)");
  194. var e = document.getElementsByTagName("div");
  195. for(var j=0,len=e.length;j<len;j++){
  196. if(traceReg.test(e[j].className)){
  197. e[j].onclick = function(){
  198. var trace = this.parentNode.parentNode;
  199. if(collapsedReg.test(trace.className))
  200. trace.className = trace.className.replace("collapsed", "expanded");
  201. else
  202. trace.className = trace.className.replace("expanded", "collapsed");
  203. }
  204. }
  205. }
  206. /*]]>*/
  207. </script>
  208. </body>
  209. </html>