exception.php 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249
  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="ja" lang="ja">
  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-family: Verdana, 'メイリオ', Meiryo, 'MS Pゴシック', 'ヒラギノ角ゴ Pro W3', 'Hiragino Kaku Gothic ProN', sans-serif;
  21. font-weight:normal;
  22. font-size:9pt;
  23. color: #000;
  24. background: #fff;
  25. }
  26. h1 {
  27. font-weight:normal;
  28. font-size: 18pt;
  29. color: #f00;
  30. margin-bottom: .5em;
  31. }
  32. h2 {
  33. font-weight:normal;
  34. font-size: 14pt;
  35. color: #800000;
  36. margin-bottom: .5em;
  37. }
  38. h3 {
  39. font-weight:bold;
  40. font-size: 11pt;
  41. }
  42. pre {
  43. font-family: Menlo, Consolas, "Lucida Console", 'MS Pゴシック', Monospace;
  44. font-weight:bold;
  45. font-size: 11pt;
  46. }
  47. pre span.error {
  48. display: block;
  49. background: #fce3e3;
  50. }
  51. pre span.ln {
  52. color: #999;
  53. padding-right: 0.5em;
  54. border-right: 1px solid #ccc;
  55. }
  56. pre span.error-ln {
  57. font-weight: bold;
  58. }
  59. .container {
  60. margin: 1em 4em;
  61. }
  62. .version {
  63. color: gray;
  64. font-size: 8pt;
  65. border-top: 1px solid #aaa;
  66. padding-top: 1em;
  67. margin-bottom: 1em;
  68. }
  69. .message {
  70. color: #000;
  71. padding: 1em;
  72. font-size: 11pt;
  73. background: #f3f3f3;
  74. -webkit-border-radius: 10px;
  75. -moz-border-radius: 10px;
  76. border-radius: 10px;
  77. margin-bottom: 1em;
  78. line-height: 160%;
  79. }
  80. .source {
  81. margin-bottom: 1em;
  82. }
  83. .code pre {
  84. background-color: #ffe;
  85. margin: 0.5em 0;
  86. padding: 0.5em;
  87. line-height: 125%;
  88. border: 1px solid #eee;
  89. }
  90. .source .file {
  91. margin-bottom: 1em;
  92. font-weight: bold;
  93. }
  94. .traces {
  95. margin: 2em 0;
  96. }
  97. .trace {
  98. margin: 0.5em 0;
  99. padding: 0.5em;
  100. }
  101. .trace.app {
  102. border: 1px dashed #c00;
  103. }
  104. .trace .number {
  105. text-align: right;
  106. width: 2em;
  107. padding: 0.5em;
  108. }
  109. .trace .content {
  110. padding: 0.5em;
  111. }
  112. .trace .plus,
  113. .trace .minus {
  114. display:inline;
  115. vertical-align:middle;
  116. text-align:center;
  117. border:1px solid #000;
  118. color:#000;
  119. font-size:10px;
  120. line-height:10px;
  121. margin:0;
  122. padding:0 1px;
  123. width:10px;
  124. height:10px;
  125. }
  126. .trace.collapsed .minus,
  127. .trace.expanded .plus,
  128. .trace.collapsed pre {
  129. display: none;
  130. }
  131. .trace-file {
  132. cursor: pointer;
  133. padding: 0.2em;
  134. }
  135. .trace-file:hover {
  136. background: #f0ffff;
  137. }
  138. /*]]>*/
  139. </style>
  140. </head>
  141. <body>
  142. <div class="container">
  143. <h1><?php echo $data['type']?></h1>
  144. <p class="message">
  145. <?php echo nl2br(htmlspecialchars($data['message'],ENT_QUOTES,Yii::app()->charset))?>
  146. </p>
  147. <div class="source">
  148. <p class="file"><?php echo htmlspecialchars($data['file'],ENT_QUOTES,Yii::app()->charset)."({$data['line']})"?></p>
  149. <?php echo $this->renderSourceCode($data['file'],$data['line'],$this->maxSourceLines); ?>
  150. </div>
  151. <div class="traces">
  152. <h2>Stack Trace</h2>
  153. <?php $count=0; ?>
  154. <table style="width:100%;">
  155. <?php foreach($data['traces'] as $n => $trace): ?>
  156. <?php
  157. if($this->isCoreCode($trace))
  158. $cssClass='core collapsed';
  159. elseif(++$count>3)
  160. $cssClass='app collapsed';
  161. else
  162. $cssClass='app expanded';
  163. $hasCode=$trace['file']!=='unknown' && is_file($trace['file']);
  164. ?>
  165. <tr class="trace <?php echo $cssClass; ?>">
  166. <td class="number">
  167. #<?php echo $n; ?>
  168. </td>
  169. <td class="content">
  170. <div class="trace-file">
  171. <?php if($hasCode): ?>
  172. <div class="plus">+</div>
  173. <div class="minus">–</div>
  174. <?php endif; ?>
  175. <?php
  176. echo '&nbsp;';
  177. echo htmlspecialchars($trace['file'],ENT_QUOTES,Yii::app()->charset)."(".$trace['line'].")";
  178. echo ': ';
  179. if(!empty($trace['class']))
  180. echo "<strong>{$trace['class']}</strong>{$trace['type']}";
  181. echo "<strong>{$trace['function']}</strong>(";
  182. if(!empty($trace['args']))
  183. echo htmlspecialchars($this->argumentsToString($trace['args']),ENT_QUOTES,Yii::app()->charset);
  184. echo ')';
  185. ?>
  186. </div>
  187. <?php if($hasCode) echo $this->renderSourceCode($trace['file'],$trace['line'],$this->maxTraceSourceLines); ?>
  188. </td>
  189. </tr>
  190. <?php endforeach; ?>
  191. </table>
  192. </div>
  193. <div class="version">
  194. <?php echo date('Y-m-d H:i:s',$data['time']) .' '. $data['version']; ?>
  195. </div>
  196. </div>
  197. <script type="text/javascript">
  198. /*<![CDATA[*/
  199. var traceReg = new RegExp("(^|\\s)trace-file(\\s|$)");
  200. var collapsedReg = new RegExp("(^|\\s)collapsed(\\s|$)");
  201. var e = document.getElementsByTagName("div");
  202. for(var j=0,len=e.length;j<len;j++){
  203. if(traceReg.test(e[j].className)){
  204. e[j].onclick = function(){
  205. var trace = this.parentNode.parentNode;
  206. if(collapsedReg.test(trace.className))
  207. trace.className = trace.className.replace("collapsed", "expanded");
  208. else
  209. trace.className = trace.className.replace("expanded", "collapsed");
  210. }
  211. }
  212. }
  213. /*]]>*/
  214. </script>
  215. </body>
  216. </html>