Exemple #1
0
 public static function initialize(Nette\Application\Application $application, Nette\Http\IRequest $httpRequest)
 {
     Debugger::$bar->addPanel(new self($application->getRouter(), $httpRequest));
     Debugger::$blueScreen->addPanel(function ($e) use($application) {
         if ($e === NULL) {
             return array('tab' => 'Nette Application', 'panel' => '<h3>Requests</h3>' . Nette\Diagnostics\Helpers::clickableDump($application->getRequests()) . '<h3>Presenter</h3>' . Nette\Diagnostics\Helpers::clickableDump($application->getPresenter()));
         }
     });
 }
Exemple #2
0
 public function getPanel()
 {
     $template = parent::getTemplate();
     $template->setFile(__DIR__ . '/templates/panel.latte');
     $template->identity = $this->identity;
     $template->user = $this->user;
     $template->dumper = function ($variable, $collapsed = false) {
         if (class_exists('Nette\\Diagnostics\\Dumper')) {
             return Dumper::toHtml($variable, [Dumper::COLLAPSE => $collapsed]);
         }
         // Nette 2.0 back compatibility
         return \Nette\Diagnostics\Helpers::clickableDump($variable, $collapsed);
     };
     ob_start();
     if ($this->parent) {
         $template->render();
     }
     return ob_get_clean();
 }
 /**
  * Dumps information about a variable in Nette Debug Bar.
  * @param  mixed  variable to dump
  * @param  string optional title
  * @return mixed  variable itself
  */
 public static function barDump($var, $title = NULL)
 {
     if (!self::$productionMode) {
         $dump = array();
         foreach (is_array($var) ? $var : array('' => $var) as $key => $val) {
             $dump[$key] = Helpers::clickableDump($val);
         }
         self::$dumpPanel->data[] = array('title' => $title, 'dump' => $dump);
     }
     return $var;
 }
 /**
  * @param $presenter Presenter
  * @param $response PresenterResponse
  * @internal
  */
 public function onShutdown($presenter, $response)
 {
     $this->response = $response;
     $application = Environment::getApplication();
     $presenter = $application->getPresenter();
     $request = $presenter->getRequest();
     $httpRequest = Environment::getHttpRequest();
     $entry = array();
     if ($signal = $presenter->getSignal()) {
         $receiver = empty($signal[0]) ? $presenter->name : $signal[0];
         $signal = $receiver . " :: " . $signal[1];
     }
     if ($response !== NULL) {
         $rInfo = get_class($response);
         if ($response->getReflection()->hasMethod('getCode')) {
             $rInfo .= ' (' . $response->code . ')';
         }
     }
     $entry['info']['presenter'] = $presenter->backlink();
     $entry['info']['response'] = $response === NULL ? 'NO RESPONSE' : $rInfo;
     $entry['info']['uri'] = $httpRequest->getUrl();
     $entry['info']['uriPath'] = $httpRequest->getUrl()->path;
     $entry['info']['request'] = $request->getMethod();
     $entry['info']['signal'] = $signal;
     $entry['info']['time'] = number_format((microtime(TRUE) - Debugger::$time) * 1000, 1, '.', ' ');
     $entry['dumps']['HttpRequest'] = Helpers::clickableDump($httpRequest);
     $entry['dumps']['PresenterRequest'] = Helpers::clickableDump($request);
     $entry['dumps']['Presenter'] = Helpers::clickableDump($presenter);
     $entry['dumps']['PresenterResponse'] = Helpers::clickableDump($response);
     foreach (self::$dumps as $key => $dump) {
         if (is_numeric($key)) {
             $entry['dumps'][] = $dump;
         } else {
             $entry['dumps'][$key] = $dump;
         }
     }
     $session = Environment::getSession('debug/RequestsPanel');
     if (!isset($session->logs)) {
         $session->logs = array();
     }
     $session->logs[] = $entry;
 }
Exemple #5
0
 public static function initializePanel(Nette\Application\Application $application)
 {
     Debugger::$blueScreen->addPanel(function ($e) use($application) {
         return $e ? NULL : array('tab' => 'Nette Application', 'panel' => '<h3>Requests</h3>' . Nette\Diagnostics\Helpers::clickableDump($application->getRequests()) . '<h3>Presenter</h3>' . Nette\Diagnostics\Helpers::clickableDump($application->getPresenter()));
     });
 }
Exemple #6
0
        function getPanel()
        {
            ob_start();
            ?>
<style class="nette-debug">#nette-debug .nette-UserPanel pre{background:#FDF5CE;padding:.4em .7em;border:1px dotted silver;overflow:auto}</style>

<div class="nette-UserPanel">
	<h1><?php 
            if ($this->user->isLoggedIn()) {
                ?>
Logged in<?php 
            } else {
                ?>
Unlogged<?php 
            }
            ?>
</h1>

	<?php 
            if ($this->user->getIdentity()) {
                echo Helpers::clickableDump($this->user->getIdentity());
            } else {
                ?>
<p>no identity</p><?php 
            }
            ?>
</div>
<?php 
            return ob_get_clean();
        }
Exemple #7
0
        function render(\Exception $exception)
        {
            $panels = $this->panels;
            static $errorTypes = array(E_ERROR => 'Fatal Error', E_USER_ERROR => 'User Error', E_RECOVERABLE_ERROR => 'Recoverable Error', E_CORE_ERROR => 'Core Error', E_COMPILE_ERROR => 'Compile Error', E_PARSE => 'Parse Error', E_WARNING => 'Warning', E_CORE_WARNING => 'Core Warning', E_COMPILE_WARNING => 'Compile Warning', E_USER_WARNING => 'User Warning', E_NOTICE => 'Notice', E_USER_NOTICE => 'User Notice', E_STRICT => 'Strict', E_DEPRECATED => 'Deprecated', E_USER_DEPRECATED => 'User Deprecated');
            $title = $exception instanceof Nette\FatalErrorException && isset($errorTypes[$exception->getSeverity()]) ? $errorTypes[$exception->getSeverity()] : get_class($exception);
            $expandPath = NETTE_DIR . DIRECTORY_SEPARATOR;
            $counter = 0;
            ?>
<!DOCTYPE html><!-- "' --></script></style></pre></xmp></table>
<html>
<head>
	<meta charset="utf-8">
	<meta name="robots" content="noindex">
	<meta name="generator" content="Nette Framework">

	<title><?php 
            echo htmlspecialchars($title);
            ?>
</title><!-- <?php 
            $ex = $exception;
            echo htmlspecialchars($ex->getMessage() . ($ex->getCode() ? ' #' . $ex->getCode() : ''));
            while (method_exists($ex, 'getPrevious') && ($ex = $ex->getPrevious()) || isset($ex->previous) && ($ex = $ex->previous)) {
                echo htmlspecialchars('; caused by ' . get_class($ex) . ' ' . $ex->getMessage() . ($ex->getCode() ? ' #' . $ex->getCode() : ''));
            }
            ?>
 -->

	<style type="text/css" class="nette-debug">html{overflow-y:scroll}body{margin:0 0 2em;padding:0}#netteBluescreen{font:9pt/1.5 Verdana,sans-serif;background:white;color:#333;position:absolute;left:0;top:0;width:100%;text-align:left}#netteBluescreen *{font:inherit;color:inherit;background:transparent;border:none;margin:0;padding:0;text-align:inherit;text-indent:0}#netteBluescreen b{font-weight:bold}#netteBluescreen i{font-style:italic}#netteBluescreen a{text-decoration:none;color:#328ADC;padding:2px 4px;margin:-2px -4px}#netteBluescreen a:hover,#netteBluescreen a:active,#netteBluescreen a:focus{color:#085AA3}#netteBluescreen a abbr{font-family:sans-serif;color:#BBB}#netteBluescreenIcon{position:absolute;right:.5em;top:.5em;z-index:20000;text-decoration:none;background:#CD1818;padding:3px}#netteBluescreenError{background:#CD1818;color:white;font:13pt/1.5 Verdana,sans-serif!important;display:block}#netteBluescreenError #netteBsSearch{color:#CD1818;font-size:.7em}#netteBluescreenError:hover #netteBsSearch{color:#ED8383}#netteBluescreen h1{font-size:18pt;font-weight:normal;text-shadow:1px 1px 0 rgba(0,0,0,.4);margin:.7em 0}#netteBluescreen h2{font:14pt/1.5 sans-serif!important;color:#888;margin:.6em 0}#netteBluescreen h3{font:bold 10pt/1.5 Verdana,sans-serif!important;margin:1em 0;padding:0}#netteBluescreen p,#netteBluescreen pre{margin:.8em 0}#netteBluescreen pre,#netteBluescreen code,#netteBluescreen table{font:9pt/1.5 Consolas,monospace!important}#netteBluescreen pre,#netteBluescreen table{background:#FDF5CE;padding:.4em .7em;border:1px dotted silver;overflow:auto}#netteBluescreen pre div{min-width:100%;float:left;_float:none;white-space:pre}#netteBluescreen table pre{padding:0;margin:0;border:none}#netteBluescreen pre .php-array,#netteBluescreen pre .php-object{color:#C22}#netteBluescreen pre .php-string{color:#080}#netteBluescreen pre .php-int,#netteBluescreen pre .php-float,#netteBluescreen pre .php-null,#netteBluescreen pre .php-bool{color:#328ADC}#netteBluescreen pre .php-visibility{font-size:85%;color:#998}#netteBluescreen pre.nette-dump a{color:#333}#netteBluescreen div.panel{padding:1px 25px}#netteBluescreen div.inner{background:#F4F3F1;padding:.1em 1em 1em;border-radius:8px;-moz-border-radius:8px;-webkit-border-radius:8px}#netteBluescreen table{border-collapse:collapse;width:100%}#netteBluescreen .outer{overflow:auto}#netteBluescreen td,#netteBluescreen th{vertical-align:top;text-align:left;padding:2px 6px;border:1px solid #e6dfbf}#netteBluescreen th{font-weight:bold}#netteBluescreen tr>:first-child{width:20%}#netteBluescreen tr:nth-child(2n),#netteBluescreen tr:nth-child(2n) pre{background-color:#F7F0CB}#netteBluescreen ol{margin:1em 0;padding-left:2.5em}#netteBluescreen ul{font:7pt/1.5 Verdana,sans-serif!important;padding:2em 4em;margin:1em 0 0;color:#777;background:#F6F5F3 url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFEAAAAjCAMAAADbuxbOAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADBQTFRF/fz24d7Y7Onj5uLd9vPu3drUzMvG09LN39zW8e7o2NbQ3NnT29jS0M7J1tXQAAAApvmsFgAAABB0Uk5T////////////////////AOAjXRkAAAKlSURBVHja7FbbsqQgDAwENEgc//9vN+SCWDtbtXPmZR/Wc6o02mlC58LA9ckFAOszvMV8xNgyUjyXhojfMVKvRL0ZHavxXYy5JrmchMdzou8YlTClxajtK8ZGGpWRoBr1+gFjKfHkJPbizabLgzE3pH7Iu4K980xgFvlrVzMZoVBWhtvouCDdcTDmTgMCJdVxJ9MKO6XxnliM7hxi5lbj2ZVM4l8DqYyKoNLYcfqBB1/LpHYxEcfVG6ZpMDgyFUVWY/Q1sSYPpIdSAKWqLWL0XqWiMWc4hpH0OQOMOAgdycY4N9Sb7wWANQs3rsDSdLAYiuxi5siVfOhBWIrtH0G3kNaF/8Q4kCPE1kMucG/ZMUBUCOgiKJkPuWWTLGVgLGpwns1DraUayCtoBqERyaYtVsm85NActRooezvSLO/sKZP/nq8n4+xcyjNsRu8zW6KWpdb7wjiQd4WrtFZYFiKHENSmWp6xshh96c2RQ+c7Lt+qbijyEjHWUJ/pZsy8MGIUuzNiPySK2Gqoh6ZTRF6ko6q3nVTkaA//itIrDpW6l3SLo8juOmqMXkYknu5FdQxWbhCfKHEGDhxxyTVaXJF3ZjSl3jMksjSOOKmne9pI+mcG5QvaUJhI9HpkmRo2NpCrDJvsktRhRE2MM6F2n7dt4OaMUq8bCctk0+PoMRzL+1l5PZ2eyM/Owr86gf8z/tOM53lom5+nVcFuB+eJVzlXwAYy9TZ9s537tfqcsJWbEU4nBngZo6FfO9T9CdhfBtmk2dLiAy8uS4zwOpMx2HqYbTC+amNeAYTpsP4SIgvWfUBWXxn3CMHW3ffd7k3+YIkx7w0t/CVGvcPejoeOlzOWzeGbawOHqXQGUTMZRcfj4XPCgW9y/fuvVn8zD9P1QHzv80uAAQA0i3Jer7Jr7gAAAABJRU5ErkJggg==') 99% 10px no-repeat;border-top:1px solid #DDD}#netteBluescreen .highlight{background:#CD1818;color:white;font-weight:bold;font-style:normal;display:block;padding:0 .4em;margin:0 -.4em}#netteBluescreen .line{color:#9F9C7F;font-weight:normal;font-style:normal}#netteBluescreen a[href^=editor\:]{color:inherit;border-bottom:1px dotted #C1D2E1}#netteBluescreen .caused{float:right;padding:.3em .6em;background:#df8075;border-radius:0 0 0 8px;white-space:nowrap}#netteBluescreen .caused a{color:white}</style>
</head>



<body>
<script>document.body.className+=" js";</script>
<div id="netteBluescreen">
	<a id="netteBluescreenIcon" href="#" rel="next"><abbr>&#x25bc;</abbr></a

	><div>
		<div id="netteBluescreenError" class="panel">
			<h1><?php 
            echo htmlspecialchars($title), $exception->getCode() ? ' #' . $exception->getCode() : '';
            ?>
</h1>

			<p><?php 
            echo htmlspecialchars($exception->getMessage());
            ?>
 <a href="http://www.google.cz/search?sourceid=nette&amp;q=<?php 
            echo urlencode($title . ' ' . preg_replace('#\'.*\'|".*"#Us', '', $exception->getMessage()));
            ?>
" id="netteBsSearch">search&#x25ba;</a></p>
		</div>

		<?php 
            if (method_exists($exception, 'getPrevious') && ($prev = $exception->getPrevious()) || isset($exception->previous) && ($prev = $exception->previous)) {
                ?>
		<div class="caused">
			<a href="#netteCaused">Caused by <?php 
                echo get_class($prev);
                ?>
</a>
		</div>
		<?php 
            }
            ?>


		<?php 
            $ex = $exception;
            $level = 0;
            ?>
		<?php 
            do {
                ?>

			<?php 
                if ($level++) {
                    ?>
			<div class="panel"<?php 
                    if ($level === 2) {
                        echo ' id="netteCaused"';
                    }
                    ?>
>
			<h2><a href="#" rel="netteBsPnl<?php 
                    echo ++$counter;
                    ?>
">Caused by <abbr><?php 
                    echo ($collapsed = $level > 2) ? '&#x25ba;' : '&#x25bc;';
                    ?>
</abbr></a></h2>

			<div id="netteBsPnl<?php 
                    echo $counter;
                    ?>
" class="<?php 
                    echo $collapsed ? 'nette-collapsed ' : '';
                    ?>
inner">
				<div class="panel">
					<h1><?php 
                    echo htmlspecialchars(get_class($ex) . ($ex->getCode() ? ' #' . $ex->getCode() : ''));
                    ?>
</h1>

					<p><b><?php 
                    echo htmlspecialchars($ex->getMessage());
                    ?>
</b></p>
				</div>
			<?php 
                }
                ?>



			<?php 
                foreach ($panels as $panel) {
                    ?>
			<?php 
                    $panel = call_user_func($panel, $ex);
                    if (empty($panel['tab']) || empty($panel['panel'])) {
                        continue;
                    }
                    ?>
			<?php 
                    if (!empty($panel['bottom'])) {
                        continue;
                    }
                    ?>
			<div class="panel">
				<h2><a href="#" rel="netteBsPnl<?php 
                    echo ++$counter;
                    ?>
"><?php 
                    echo htmlSpecialChars($panel['tab']);
                    ?>
 <abbr>&#x25bc;</abbr></a></h2>

				<div id="netteBsPnl<?php 
                    echo $counter;
                    ?>
" class="inner">
				<?php 
                    echo $panel['panel'];
                    ?>
			</div></div>
			<?php 
                }
                ?>



			<?php 
                $stack = $ex->getTrace();
                $expanded = NULL;
                ?>
			<?php 
                if (strpos($ex->getFile(), $expandPath) === 0) {
                    foreach ($stack as $key => $row) {
                        if (isset($row['file']) && strpos($row['file'], $expandPath) !== 0) {
                            $expanded = $key;
                            break;
                        }
                    }
                }
                ?>

			<div class="panel">
			<h2><a href="#" rel="netteBsPnl<?php 
                echo ++$counter;
                ?>
">Source file <abbr><?php 
                echo ($collapsed = $expanded !== NULL) ? '&#x25ba;' : '&#x25bc;';
                ?>
</abbr></a></h2>

			<div id="netteBsPnl<?php 
                echo $counter;
                ?>
" class="<?php 
                echo $collapsed ? 'nette-collapsed ' : '';
                ?>
inner">
				<p><b>File:</b> <?php 
                echo Helpers::editorLink($ex->getFile(), $ex->getLine());
                ?>
 &nbsp; <b>Line:</b> <?php 
                echo $ex->getLine();
                ?>
</p>
				<?php 
                if (is_file($ex->getFile())) {
                    echo self::highlightFile($ex->getFile(), $ex->getLine(), 15, isset($ex->context) ? $ex->context : NULL);
                }
                ?>
			</div></div>



			<?php 
                if (isset($stack[0]['class']) && $stack[0]['class'] === 'Nette\\Diagnostics\\Debugger' && ($stack[0]['function'] === '_shutdownHandler' || $stack[0]['function'] === '_errorHandler')) {
                    unset($stack[0]);
                }
                ?>
			<?php 
                if ($stack) {
                    ?>
			<div class="panel">
				<h2><a href="#" rel="netteBsPnl<?php 
                    echo ++$counter;
                    ?>
">Call stack <abbr>&#x25bc;</abbr></a></h2>

				<div id="netteBsPnl<?php 
                    echo $counter;
                    ?>
" class="inner">
				<ol>
					<?php 
                    foreach ($stack as $key => $row) {
                        ?>
					<li><p>

					<?php 
                        if (isset($row['file']) && is_file($row['file'])) {
                            ?>
						<?php 
                            echo Helpers::editorLink($row['file'], $row['line']), ':', $row['line'];
                            ?>
					<?php 
                        } else {
                            ?>
						<i>inner-code</i><?php 
                            if (isset($row['line'])) {
                                echo ':', $row['line'];
                            }
                            ?>
					<?php 
                        }
                        ?>

					<?php 
                        if (isset($row['file']) && is_file($row['file'])) {
                            ?>
<a href="#" rel="netteBsSrc<?php 
                            echo "{$level}-{$key}";
                            ?>
">source <abbr>&#x25ba;</abbr></a>&nbsp; <?php 
                        }
                        ?>

					<?php 
                        if (isset($row['class'])) {
                            echo htmlspecialchars($row['class'] . $row['type']);
                        }
                        ?>
					<?php 
                        echo htmlspecialchars($row['function']);
                        ?>

					(<?php 
                        if (!empty($row['args'])) {
                            ?>
<a href="#" rel="netteBsArgs<?php 
                            echo "{$level}-{$key}";
                            ?>
">arguments <abbr>&#x25ba;</abbr></a><?php 
                        }
                        ?>
)
					</p>

					<?php 
                        if (!empty($row['args'])) {
                            ?>
						<div class="nette-collapsed outer" id="netteBsArgs<?php 
                            echo "{$level}-{$key}";
                            ?>
">
						<table>
						<?php 
                            try {
                                $r = isset($row['class']) ? new \ReflectionMethod($row['class'], $row['function']) : new \ReflectionFunction($row['function']);
                                $params = $r->getParameters();
                            } catch (\Exception $e) {
                                $params = array();
                            }
                            foreach ($row['args'] as $k => $v) {
                                echo '<tr><th>', htmlspecialchars(isset($params[$k]) ? '$' . $params[$k]->name : "#{$k}"), '</th><td>';
                                echo Helpers::clickableDump($v);
                                echo "</td></tr>\n";
                            }
                            ?>
						</table>
						</div>
					<?php 
                        }
                        ?>


					<?php 
                        if (isset($row['file']) && is_file($row['file'])) {
                            ?>
						<div <?php 
                            if ($expanded !== $key) {
                                echo 'class="nette-collapsed"';
                            }
                            ?>
 id="netteBsSrc<?php 
                            echo "{$level}-{$key}";
                            ?>
"><?php 
                            echo self::highlightFile($row['file'], $row['line']);
                            ?>
</div>
					<?php 
                        }
                        ?>

					</li>
					<?php 
                    }
                    ?>
				</ol>
			</div></div>
			<?php 
                }
                ?>



			<?php 
                if (isset($ex->context) && is_array($ex->context)) {
                    ?>
			<div class="panel">
			<h2><a href="#" rel="netteBsPnl<?php 
                    echo ++$counter;
                    ?>
">Variables <abbr>&#x25ba;</abbr></a></h2>

			<div id="netteBsPnl<?php 
                    echo $counter;
                    ?>
" class="nette-collapsed inner">
			<div class="outer">
			<table>
			<?php 
                    foreach ($ex->context as $k => $v) {
                        echo '<tr><th>$', htmlspecialchars($k), '</th><td>', Helpers::clickableDump($v), "</td></tr>\n";
                    }
                    ?>
			</table>
			</div>
			</div></div>
			<?php 
                }
                ?>

		<?php 
            } while (method_exists($ex, 'getPrevious') && ($ex = $ex->getPrevious()) || isset($ex->previous) && ($ex = $ex->previous));
            ?>
		<?php 
            while (--$level) {
                echo '</div></div>';
            }
            ?>



		<?php 
            $bottomPanels = array();
            ?>
		<?php 
            foreach ($panels as $panel) {
                ?>
		<?php 
                $panel = call_user_func($panel, NULL);
                if (empty($panel['tab']) || empty($panel['panel'])) {
                    continue;
                }
                ?>
		<?php 
                if (!empty($panel['bottom'])) {
                    $bottomPanels[] = $panel;
                    continue;
                }
                ?>
		<div class="panel">
			<h2><a href="#" rel="netteBsPnl<?php 
                echo ++$counter;
                ?>
"><?php 
                echo htmlSpecialChars($panel['tab']);
                ?>
 <abbr>&#x25ba;</abbr></a></h2>

			<div id="netteBsPnl<?php 
                echo $counter;
                ?>
" class="nette-collapsed inner">
			<?php 
                echo $panel['panel'];
                ?>
		</div></div>
		<?php 
            }
            ?>



		<div class="panel">
		<h2><a href="#" rel="netteBsPnl<?php 
            echo ++$counter;
            ?>
">Environment <abbr>&#x25ba;</abbr></a></h2>

		<div id="netteBsPnl<?php 
            echo $counter;
            ?>
" class="nette-collapsed inner">
			<h3><a href="#" rel="netteBsPnl<?php 
            echo ++$counter;
            ?>
">$_SERVER <abbr>&#x25bc;</abbr></a></h3>
			<div id="netteBsPnl<?php 
            echo $counter;
            ?>
" class="outer">
			<table>
			<?php 
            foreach ($_SERVER as $k => $v) {
                echo '<tr><th>', htmlspecialchars($k), '</th><td>', Helpers::clickableDump($v), "</td></tr>\n";
            }
            ?>
			</table>
			</div>


			<h3><a href="#" rel="netteBsPnl<?php 
            echo ++$counter;
            ?>
">$_SESSION <abbr>&#x25bc;</abbr></a></h3>
			<div id="netteBsPnl<?php 
            echo $counter;
            ?>
" class="outer">
			<?php 
            if (empty($_SESSION)) {
                ?>
			<p><i>empty</i></p>
			<?php 
            } else {
                ?>
			<table>
			<?php 
                foreach ($_SESSION as $k => $v) {
                    echo '<tr><th>', htmlspecialchars($k), '</th><td>', $k === '__NF' ? '<i>Nette Session</i>' : Helpers::clickableDump($v), "</td></tr>\n";
                }
                ?>
			</table>
			<?php 
            }
            ?>
			</div>


			<?php 
            if (!empty($_SESSION['__NF']['DATA'])) {
                ?>
			<h3><a href="#" rel="netteBsPnl<?php 
                echo ++$counter;
                ?>
">Nette Session <abbr>&#x25bc;</abbr></a></h3>
			<div id="netteBsPnl<?php 
                echo $counter;
                ?>
" class="outer">
			<table>
			<?php 
                foreach ($_SESSION['__NF']['DATA'] as $k => $v) {
                    echo '<tr><th>', htmlspecialchars($k), '</th><td>', Helpers::clickableDump($v), "</td></tr>\n";
                }
                ?>
			</table>
			</div>
			<?php 
            }
            ?>


			<?php 
            $list = get_defined_constants(TRUE);
            if (!empty($list['user'])) {
                ?>
			<h3><a href="#" rel="netteBsPnl<?php 
                echo ++$counter;
                ?>
">Constants <abbr>&#x25ba;</abbr></a></h3>
			<div id="netteBsPnl<?php 
                echo $counter;
                ?>
" class="outer nette-collapsed">
			<table>
			<?php 
                foreach ($list['user'] as $k => $v) {
                    echo '<tr><th>', htmlspecialchars($k), '</th>';
                    echo '<td>', Helpers::clickableDump($v), "</td></tr>\n";
                }
                ?>
			</table>
			</div>
			<?php 
            }
            ?>


			<h3><a href="#" rel="netteBsPnl<?php 
            echo ++$counter;
            ?>
">Included files <abbr>&#x25ba;</abbr></a> (<?php 
            echo count(get_included_files());
            ?>
)</h3>
			<div id="netteBsPnl<?php 
            echo $counter;
            ?>
" class="outer nette-collapsed">
			<table>
			<?php 
            foreach (get_included_files() as $v) {
                echo '<tr><td>', htmlspecialchars($v), "</td></tr>\n";
            }
            ?>
			</table>
			</div>


			<h3><a href="#" rel="netteBsPnl<?php 
            echo ++$counter;
            ?>
">Configuration options <abbr>&#x25ba;</abbr></a></h3>
			<div id="netteBsPnl<?php 
            echo $counter;
            ?>
" class="outer nette-collapsed">
			<?php 
            ob_start();
            @phpinfo(INFO_CONFIGURATION | INFO_MODULES);
            echo preg_replace('#^.+<body>|</body>.+\\z#s', '', ob_get_clean());
            ?>
			</div>
		</div></div>



		<div class="panel">
		<h2><a href="#" rel="netteBsPnl<?php 
            echo ++$counter;
            ?>
">HTTP request <abbr>&#x25ba;</abbr></a></h2>

		<div id="netteBsPnl<?php 
            echo $counter;
            ?>
" class="nette-collapsed inner">
			<?php 
            if (function_exists('apache_request_headers')) {
                ?>
			<h3>Headers</h3>
			<div class="outer">
			<table>
			<?php 
                foreach (apache_request_headers() as $k => $v) {
                    echo '<tr><th>', htmlspecialchars($k), '</th><td>', htmlspecialchars($v), "</td></tr>\n";
                }
                ?>
			</table>
			</div>
			<?php 
            }
            ?>


			<?php 
            foreach (array('_GET', '_POST', '_COOKIE') as $name) {
                ?>
			<h3>$<?php 
                echo htmlspecialchars($name);
                ?>
</h3>
			<?php 
                if (empty($GLOBALS[$name])) {
                    ?>
			<p><i>empty</i></p>
			<?php 
                } else {
                    ?>
			<div class="outer">
			<table>
			<?php 
                    foreach ($GLOBALS[$name] as $k => $v) {
                        echo '<tr><th>', htmlspecialchars($k), '</th><td>', Helpers::clickableDump($v), "</td></tr>\n";
                    }
                    ?>
			</table>
			</div>
			<?php 
                }
                ?>
			<?php 
            }
            ?>
		</div></div>



		<div class="panel">
		<h2><a href="#" rel="netteBsPnl<?php 
            echo ++$counter;
            ?>
">HTTP response <abbr>&#x25ba;</abbr></a></h2>

		<div id="netteBsPnl<?php 
            echo $counter;
            ?>
" class="nette-collapsed inner">
			<h3>Headers</h3>
			<?php 
            if (headers_list()) {
                ?>
			<pre><?php 
                foreach (headers_list() as $s) {
                    echo htmlspecialchars($s), '<br>';
                }
                ?>
</pre>
			<?php 
            } else {
                ?>
			<p><i>no headers</i></p>
			<?php 
            }
            ?>
		</div></div>



		<?php 
            foreach ($bottomPanels as $panel) {
                ?>
		<div class="panel">
			<h2><a href="#" rel="netteBsPnl<?php 
                echo ++$counter;
                ?>
"><?php 
                echo htmlSpecialChars($panel['tab']);
                ?>
 <abbr>&#x25bc;</abbr></a></h2>

			<div id="netteBsPnl<?php 
                echo $counter;
                ?>
" class="inner">
			<?php 
                echo $panel['panel'];
                ?>
		</div></div>
		<?php 
            }
            ?>



		<ul>
			<li>Report generated at <?php 
            echo @date('Y/m/d H:i:s', Debugger::$time);
            ?>
</li>
			<?php 
            if (preg_match('#^https?://#', Debugger::$source)) {
                ?>
				<li><a href="<?php 
                echo htmlSpecialChars(Debugger::$source);
                ?>
"><?php 
                echo htmlSpecialChars(Debugger::$source);
                ?>
</a></li>
			<?php 
            } elseif (Debugger::$source) {
                ?>
				<li><?php 
                echo htmlSpecialChars(Debugger::$source);
                ?>
</li>
			<?php 
            }
            ?>
			<li>PHP <?php 
            echo htmlSpecialChars(PHP_VERSION);
            ?>
</li>
			<?php 
            if (isset($_SERVER['SERVER_SOFTWARE'])) {
                ?>
<li><?php 
                echo htmlSpecialChars($_SERVER['SERVER_SOFTWARE']);
                ?>
</li><?php 
            }
            ?>
			<?php 
            if (class_exists('Nette\\Framework')) {
                ?>
<li><?php 
                echo htmlSpecialChars('Nette Framework ' . Nette\Framework::VERSION);
                ?>
 <i>(revision <?php 
                echo htmlSpecialChars(Nette\Framework::REVISION);
                ?>
)</i></li><?php 
            }
            ?>
		</ul>
	</div>
</div>

<script type="text/javascript">/*<![CDATA[*/var bs=document.getElementById("netteBluescreen");document.body.appendChild(bs);document.onkeyup=function(b){b=b||window.event;if(27==b.keyCode&&!(b.shiftKey||b.altKey||b.ctrlKey||b.metaKey))bs.onclick({target:document.getElementById("netteBluescreenIcon")})};
for(var i=0,styles=document.styleSheets;i<styles.length;i++)"nette-debug"!==(styles[i].owningElement||styles[i].ownerNode).className?(styles[i].oldDisabled=styles[i].disabled,styles[i].disabled=!0):styles[i].addRule?styles[i].addRule(".nette-collapsed","display: none"):styles[i].insertRule(".nette-collapsed { display: none }",0);
bs.onclick=function(b){b=b||window.event;for(var a=b.target||b.srcElement;a&&a.tagName&&"a"!==a.tagName.toLowerCase();)a=a.parentNode;if(!a||!a.rel)return!0;for(var d=a.getElementsByTagName("abbr")[0],c="next"===a.rel?a.nextSibling:document.getElementById(a.rel);1!==c.nodeType;)c=c.nextSibling;b=c.currentStyle?"none"==c.currentStyle.display:"none"==getComputedStyle(c,null).display;try{d.innerHTML=String.fromCharCode(b?9660:9658)}catch(e){}c.style.display=b?"code"===c.tagName.toLowerCase()?"inline":
"block":"none";if("netteBluescreenIcon"===a.id)for(a=0,d=document.styleSheets;a<d.length;a++)"nette-debug"!==(d[a].owningElement||d[a].ownerNode).className&&(d[a].disabled=b?!0:d[a].oldDisabled);return!1};/*]]>*/</script>
</body>
</html>
<?php 
        }
Exemple #8
0
 /**
  * @param \Exception $e
  * @return array
  */
 public static function renderException($e)
 {
     if ($e instanceof PayPal\ErrorResponseException) {
         return array('tab' => 'PayPalRequest', 'panel' => '<p><b>Request:</b></p>' . Nette\Diagnostics\Helpers::clickableDump($e->getData(), TRUE) . '<p><b>Response:</b></p>' . Nette\Diagnostics\Helpers::clickableDump($e->getResponse(), TRUE));
     }
 }
 /**
  * @param array
  * @return string
  */
 protected function processQuery(array $query)
 {
     $s = '<tr>';
     $s .= '<td>' . sprintf('%0.3f', $query[self::TIME] * 1000);
     if ($this->doExplains && isset($query[self::EXPLAIN])) {
         static $counter;
         $counter++;
         $s .= "<br /><a href='#' class='nette-toggler' rel='#nette-Doctrine2Panel-row-{$counter}'>explain&nbsp;&#x25ba;</a>";
     }
     $s .= '</td>';
     $s .= '<td class="nette-Doctrine2Panel-sql" style="min-width: 400px">' . Helpers::dumpSql($query[self::SQL]);
     if ($this->doExplains && isset($query[self::EXPLAIN])) {
         $s .= "<table id='nette-Doctrine2Panel-row-{$counter}' class='nette-collapsed'><tr>";
         foreach ($query[self::EXPLAIN][0] as $col => $foo) {
             $s .= '<th>' . htmlSpecialChars($col) . '</th>';
         }
         $s .= '</tr>';
         foreach ($query[self::EXPLAIN] as $row) {
             $s .= '<tr>';
             foreach ($row as $col) {
                 $s .= '<td>' . htmlSpecialChars($col) . '</td>';
             }
             $s .= '</tr>';
         }
         $s .= '</table>';
     }
     $s .= '</td>';
     $s .= '<td>' . \Nette\Diagnostics\Helpers::clickableDump($query[self::PARAMS], TRUE) . '</td>';
     $s .= '</tr>';
     return $s;
 }
Exemple #10
0
 public static function dump($variable, $collapsed = false)
 {
     if (class_exists('Nette\\Diagnostics\\Dumper')) {
         return \Nette\Diagnostics\Dumper::toHtml($variable, [\Nette\Diagnostics\Dumper::COLLAPSE => $collapsed]);
     }
     // Nette 2.0 back compatibility
     return \Nette\Diagnostics\Helpers::clickableDump($variable, $collapsed);
 }
Exemple #11
0
	/**
	 * @param array
	 * @return string
	 */
	protected function processQuery(array $query)
	{
		$s = '';
		$h = 'htmlSpecialChars';
		list($sql, $params, $time, $rows, $connection, $source) = $query;

		$s .= '<tr><td>' . sprintf('%0.3f', $time * 1000);

		$s .= '</td><td class="nette-Doctrine2Panel-sql">' . Connection::highlightSql($sql);
		if ($source) {
			list($file, $line) = $source;
			if (Debugger::$editor) {
				$s .= \Nette\Diagnostics\Helpers::editorLink($file, $line);
			} else {
				$s .= "<span class='nette-Doctrine2Panel-source' title='{$h($file)}:$line'>"
					. $h(basename(dirname($file)) . '/' . basename($file)) . ":" . $line . "</span>";
			}
		}

		$s .= '</td><td>';
		$s .= \Nette\Diagnostics\Helpers::clickableDump($params, TRUE);
		$s .= '</td><td>' . $rows . '</td></tr>';
		return $s;
	}