1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-07 22:56:35 +02:00

Debug Bar fix

This commit is contained in:
David Grudl
2010-04-06 12:36:05 +02:00
parent 52e5d43416
commit 550be3b10a
2 changed files with 6 additions and 5 deletions

View File

@@ -80,7 +80,7 @@ class DibiException extends Exception implements /*Nette\*/IDebugPanel
*/ */
public function getPanel() public function getPanel()
{ {
return dibi::dump($this->sql, TRUE); return $this->sql ? dibi::dump($this->sql, TRUE) : NULL;
} }

View File

@@ -45,7 +45,7 @@ class DibiProfiler extends DibiObject implements IDibiProfiler, /*Nette\*/IDebug
public function __construct() public function __construct()
{ {
if (class_exists(/*Nette\*/'Debug', FALSE) && is_callable('Debug::addPanel')) { if (class_exists(/*Nette\*/'Debug', FALSE) && is_callable(/*Nette\*/'Debug::addPanel')) {
/*Nette\*/Debug::addPanel($this); /*Nette\*/Debug::addPanel($this);
} }
@@ -241,7 +241,7 @@ class DibiProfiler extends DibiObject implements IDibiProfiler, /*Nette\*/IDebug
if (!dibi::$numOfQueries) return; if (!dibi::$numOfQueries) return;
$content = " $content = "
<h1>SQL queries: " . dibi::$numOfQueries . (dibi::$totalTime === NULL ? '' : ', elapsed time: ' . sprintf('%0.3f', dibi::$totalTime * 1000) . ' ms') . "</h1> <h1>Queries: " . dibi::$numOfQueries . (dibi::$totalTime === NULL ? '' : ', time: ' . sprintf('%0.3f', dibi::$totalTime * 1000) . ' ms') . "</h1>
<style> <style>
#nette-debug-DibiProfiler td.dibi-sql { background: white } #nette-debug-DibiProfiler td.dibi-sql { background: white }
@@ -249,7 +249,8 @@ class DibiProfiler extends DibiObject implements IDibiProfiler, /*Nette\*/IDebug
#nette-debug-DibiProfiler .dibi-sql div { display: none; margin-top: 10px; max-height: 150px; overflow:auto } #nette-debug-DibiProfiler .dibi-sql div { display: none; margin-top: 10px; max-height: 150px; overflow:auto }
</style> </style>
<table class='nette-inner'> <div class='nette-inner'>
<table>
<tr> <tr>
<th>Time</th><th>SQL Statement</th><th>Rows</th><th>Connection</th> <th>Time</th><th>SQL Statement</th><th>Rows</th><th>Connection</th>
</tr> </tr>
@@ -269,7 +270,7 @@ class DibiProfiler extends DibiObject implements IDibiProfiler, /*Nette\*/IDebug
</tr> </tr>
"; ";
} }
$content .= '</table>'; $content .= '</table></div>';
return $content; return $content;
} }