Source for file bluescreen.phtml
Documentation is available at bluescreen.phtml
- 1: <?php
- 3: /**
- 4: * Nette Framework - Debugger bluescreen template.
- 5: *
- 6: * Copyright (c) 2004, 2009 David Grudl (http://davidgrudl.com)
- 7: *
- 8: * This source file is subject to the "Nette license" that is bundled
- 9: * with this package in the file license.txt.
- 10: *
- 11: * For more information please see http://nettephp.com
- 12: *
- 19: *
- 25: */
- 31: /**
- 32: * Prints source code.
- 37: */
- 39: {
- 46: }
- 63: }
- 64: }
- 82: }
- 83: }
- 85: }
- 89: /**
- 90: * Dumps variable.
- 93: */
- 95: {
- 96: return preg_replace_callback('#(<pre class="dump">|\s+)?(.*)\((\d+)\) <code>#', '_netteDumpCb', Debug::dump($var, TRUE));
- 97: }
- 100: {
- 102: }
- 106: /**
- 107: * Opens panel.
- 111: */
- 113: {
- 116: ?>
- 117: <div class="panel">
- 118: <h2><a href="#" onclick="return !netteToggle(this, 'pnl<?php echo $id ?>')"><?php echo htmlSpecialChars($name) ?> <abbr><?php echo $collapsed ? '►' : '▼' ?></abbr></a></h2>
- 121: <?php
- 122: }
- 126: /**
- 127: * Closes panel.
- 129: */
- 131: {
- 132: ?>
- 133: </div>
- 134: </div>
- 135: <?php
- 136: }
- 138: }
- 141: /**
- 142: * Page title.
- 143: */
- 161: $title = ($exception instanceof FatalErrorException && isset($errorTypes[$exception->getSeverity()])) ? $errorTypes[$exception->getSeverity()] : get_class($exception);
- 166: }
- 168: ?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
- 169: <html lang="en">
- 170: <head>
- 171: <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- 172: <meta name="robots" content="noindex,noarchive">
- 173: <meta name="generator" content="Nette Framework">
- 175: <title><?php echo htmlspecialchars($title) ?></title><!-- <?php echo $exception->getMessage(), ($exception->getCode() ? ' #' . $exception->getCode() : '') ?> -->
- 177: <style type="text/css">
- 178: /* <![CDATA[ */
- 179: body {
- 180: margin: 0 0 2em;
- 181: padding: 0;
- 182: }
- 184: #netteBluescreen {
- 185: font: 9pt/1.5 Verdana, sans-serif;
- 186: background: white;
- 187: color: #333;
- 188: position: absolute;
- 189: left: 0;
- 190: top: 0;
- 191: width: 100%;
- 192: z-index: 23178;
- 193: text-align: left;
- 194: }
- 196: #netteBluescreen * {
- 197: color: inherit;
- 198: background: inherit;
- 199: text-align: inherit;
- 200: }
- 202: #netteBluescreenIcon {
- 203: position: absolute;
- 204: right: .5em;
- 205: top: .5em;
- 206: z-index: 23179;
- 207: text-decoration: none;
- 208: background: red;
- 209: padding: 3px;
- 210: }
- 212: #netteBluescreenIcon abbr {
- 213: color: black !important;
- 214: }
- 216: #netteBluescreen h1 {
- 217: font: 18pt/1.5 Verdana, sans-serif !important;
- 218: margin: .6em 0;
- 219: }
- 221: #netteBluescreen h2 {
- 222: font: 14pt/1.5 sans-serif !important;
- 223: color: #888;
- 224: margin: .6em 0;
- 225: }
- 227: #netteBluescreen a {
- 228: text-decoration: none;
- 229: color: #4197E3;
- 230: }
- 232: #netteBluescreen a abbr {
- 233: font-family: sans-serif;
- 234: color: #999;
- 235: }
- 237: #netteBluescreen h3 {
- 238: font: bold 10pt/1.5 Verdana, sans-serif !important;
- 239: margin: 1em 0;
- 240: padding: 0;
- 241: }
- 243: #netteBluescreen p {
- 244: margin: .8em 0
- 245: }
- 247: #netteBluescreen pre, #netteBluescreen code, #netteBluescreen table {
- 248: font: 9pt/1.5 Consolas, monospace !important;
- 249: }
- 251: #netteBluescreen pre, #netteBluescreen table {
- 252: background: #fffbcc;
- 253: padding: .4em .7em;
- 254: border: 1px dotted silver;
- 255: }
- 257: #netteBluescreen table pre {
- 258: padding: 0;
- 259: margin: 0;
- 260: border: none;
- 261: }
- 263: #netteBluescreen pre.dump span {
- 264: color: #c16549;
- 265: }
- 267: #netteBluescreen pre.dump a {
- 268: color: #333;
- 269: }
- 271: #netteBluescreen div.panel {
- 272: border-bottom: 1px solid #eee;
- 273: padding: 1px 2em;
- 274: }
- 276: #netteBluescreen div.inner {
- 277: padding: 0.1em 1em 1em;
- 278: background: #f5f5f5;
- 279: }
- 281: #netteBluescreen table {
- 282: border-collapse: collapse;
- 283: width: 100%;
- 284: }
- 286: #netteBluescreen td, #netteBluescreen th {
- 287: vertical-align: top;
- 288: text-align: left;
- 289: padding: 2px 3px;
- 290: border: 1px solid #eeeebb;
- 291: }
- 293: #netteBluescreen th {
- 294: width: 10%;
- 295: font-weight: bold;
- 296: }
- 298: #netteBluescreen .odd, #netteBluescreen .odd pre {
- 299: background-color: #faf5c3;
- 300: }
- 302: #netteBluescreen ul {
- 303: font: 7pt/1.5 Verdana, sans-serif !important;
- 304: padding: 1em 2em 50px;
- 305: }
- 307: #netteBluescreen .highlight, #netteBluescreenError {
- 308: background: red;
- 309: color: white;
- 310: font-weight: bold;
- 311: font-style: normal;
- 312: display: block;
- 313: }
- 315: #netteBluescreen .line {
- 316: color: #9e9e7e;
- 317: font-weight: normal;
- 318: font-style: normal;
- 319: }
- 321: /* ]]> */
- 322: </style>
- 325: <script type="text/javascript">
- 326: /* <![CDATA[ */
- 327: document.write('<style> .collapsed { display: none; } <\/style>');
- 329: function netteToggle(link, panelId)
- 330: {
- 331: var arrow = link.getElementsByTagName('abbr')[0];
- 332: var panel = panelId ? document.getElementById(panelId) : link.nextSibling;
- 333: while (panel.nodeType !== 1) panel = panel.nextSibling;
- 334: var collapsed = panel.currentStyle ? panel.currentStyle.display == 'none' : getComputedStyle(panel, null).display == 'none';
- 336: arrow.innerHTML = String.fromCharCode(collapsed ? 0x25bc : 0x25ba);
- 337: panel.style.display = collapsed ? (panel.tagName.toLowerCase() === 'code' ? 'inline' : 'block') : 'none';
- 339: return true;
- 340: }
- 341: /* ]]> */
- 342: </script>
- 343: </head>
- 347: <body>
- 348: <div id="netteBluescreen">
- 349: <a id="netteBluescreenIcon" href="#" onclick="return !netteToggle(this)"><abbr>▼</abbr></a
- 351: ><div>
- 352: <div id="netteBluescreenError" class="panel">
- 353: <h1><?php echo htmlspecialchars($title), ($exception->getCode() ? ' #' . $exception->getCode() : '') ?></h1>
- 356: </div>
- 365: <div class="panel">
- 366: <h1><?php echo htmlspecialchars(get_class($ex)), ($ex->getCode() ? ' #' . $ex->getCode() : '') ?></h1>
- 369: </div>
- 375: <p><strong>File:</strong> <?php echo htmlspecialchars($ex->getFile()) ?> <strong>Line:</strong> <?php echo $ex->getLine() ?></p>
- 383: <ol>
- 385: <li><p>
- 390: <PHP inner-code>
- 398: (<?php if (!empty($row['args'])): ?><a href="#" onclick="return !netteToggle(this, 'args<?php echo "$level-$key" ?>')">arguments <abbr>►</abbr></a><?php endif ?>)
- 399: </p>
- 403: <table>
- 404: <?php
- 406: $r = isset($row['class']) ? new ReflectionMethod($row['class'], $row['function']) : new ReflectionFunction($row['function']);
- 410: }
- 415: }
- 416: ?>
- 417: </table>
- 418: </div>
- 423: <pre <?php if (!$collapsed || isset($internals[$row['file']])) echo 'class="collapsed"'; else $collapsed = FALSE ?> id="src<?php echo "$level-$key" ?>"><?php _netteDebugPrintCode($row['file'], $row['line']) ?></pre>
- 426: </li>
- 430: <li><i>empty</i></li>
- 432: </ol>
- 449: <table>
- 450: <?php
- 453: }
- 454: ?>
- 455: </table>
- 459: <?php } while ((method_exists($ex, 'getPrevious') && $ex = $ex->getPrevious()) || (isset($ex->previous) && $ex = $ex->previous)); ?>
- 466: <h3>Requests</h3>
- 469: <h3>Presenter</h3>
- 477: <?php
- 480: <h3><a href="#" onclick="return !netteToggle(this, 'pnl-env-const')">Constants <abbr>▼</abbr></a></h3>
- 481: <table id="pnl-env-const">
- 482: <?php
- 486: }
- 487: ?>
- 488: </table>
- 492: <h3><a href="#" onclick="return !netteToggle(this, 'pnl-env-files')">Included files <abbr>►</abbr></a>(<?php echo count(get_included_files()) ?>)</h3>
- 493: <table id="pnl-env-files" class="collapsed">
- 494: <?php
- 497: }
- 498: ?>
- 499: </table>
- 502: <h3>$_SERVER</h3>
- 504: <p><i>empty</i></p>
- 506: <table>
- 507: <?php
- 508: foreach ($_SERVER as $k => $v) echo '<tr'.($rn++%2?' class="odd"':'').'><th>', htmlspecialchars($k), '</th><td>', _netteDump($v), "</td></tr>\n";
- 509: ?>
- 510: </table>
- 518: <h3>Headers</h3>
- 519: <table>
- 520: <?php
- 521: foreach (apache_request_headers() as $k => $v) echo '<tr'.($rn++%2?' class="odd"':'').'><th>', htmlspecialchars($k), '</th><td>', htmlspecialchars($v), "</td></tr>\n";
- 522: ?>
- 523: </table>
- 530: <p><i>empty</i></p>
- 532: <table>
- 533: <?php
- 534: foreach ($GLOBALS[$name] as $k => $v) echo '<tr'.($rn++%2?' class="odd"':'').'><th>', htmlspecialchars($k), '</th><td>', _netteDump($v), "</td></tr>\n";
- 535: ?>
- 536: </table>
- 544: <h3>Headers</h3>
- 546: <pre><?php
- 548: ?></pre>
- 550: <p><i>no headers</i></p>
- 555: <ul>
- 557: <?php foreach ((array) call_user_func($callback, 'bluescreen') as $line): ?><li><?php echo $line, "\n" ?></li><?php endforeach ?>
- 559: </ul>
- 560: </div>
- 561: </div>
- 563: <script type="text/javascript">
- 564: document.body.appendChild(document.getElementById('netteBluescreen'));
- 565: </script>
- 566: </body>
- 567: </html>