diff --git a/dibi/Nette/IDebuggable.php b/dibi/Nette/IDebuggable.php deleted file mode 100644 index da195ff2..00000000 --- a/dibi/Nette/IDebuggable.php +++ /dev/null @@ -1,39 +0,0 @@ - self::MAX_LENGTH ? substr($sql, 0, self::MAX_LENGTH) . '...' : $sql, + strlen($sql) > self::$maxLength ? substr($sql, 0, self::$maxLength) . '...' : $sql, $count, $connection->getConfig('driver') . '/' . $connection->getConfig('name') ); - } - if ($this->useFirebug && !headers_sent()) { - header('X-Wf-Protocol-dibi: http://meta.wildfirehq.org/Protocol/JsonStream/0.2'); - header('X-Wf-dibi-Plugin-1: http://meta.firephp.org/Wildfire/Plugin/FirePHP/Library-FirePHPCore/0.2.0'); - header('X-Wf-dibi-Structure-1: http://meta.firephp.org/Wildfire/Structure/FirePHP/FirebugConsole/0.1'); + if ($this->useFirebug && !headers_sent()) { + header('X-Wf-Protocol-dibi: http://meta.wildfirehq.org/Protocol/JsonStream/0.2'); + header('X-Wf-dibi-Plugin-1: http://meta.firephp.org/Wildfire/Plugin/FirePHP/Library-FirePHPCore/0.2.0'); + header('X-Wf-dibi-Structure-1: http://meta.firephp.org/Wildfire/Structure/FirePHP/FirebugConsole/0.1'); - $payload = json_encode(array( - array( - 'Type' => 'TABLE', - 'Label' => 'dibi profiler (' . dibi::$numOfQueries . ' SQL queries took ' . sprintf('%0.3f', dibi::$totalTime * 1000) . ' ms)', - ), - self::$table, - )); - foreach (str_split($payload, 4990) as $num => $s) { - $num++; - header("X-Wf-dibi-1-1-d$num: |$s|\\"); // protocol-, structure-, plugin-, message-index + $payload = json_encode(array( + array( + 'Type' => 'TABLE', + 'Label' => 'dibi profiler (' . dibi::$numOfQueries . ' SQL queries took ' . sprintf('%0.3f', dibi::$totalTime * 1000) . ' ms)', + ), + self::$table, + )); + foreach (str_split($payload, 4990) as $num => $s) { + $num++; + header("X-Wf-dibi-1-1-d$num: |$s|\\"); // protocol-, structure-, plugin-, message-index + } + header("X-Wf-dibi-1-1-d$num: |$s|"); } - header("X-Wf-dibi-1-1-d$num: |$s|"); } if ($this->file) { @@ -228,19 +228,15 @@ class DibiProfiler extends DibiObject implements IDibiProfiler, /*Nette\*/IDebug if (!dibi::$numOfQueries) return; $content = '
$row[0] | $row[1] | $row[2] | $row[3] |
---|---|---|---|
$row[0] | $row[1] | $row[2] | $row[3] |
$row[0] | $row[1] | $row[2] | $row[3] |
---|---|---|---|
$row[0] | $row[1] | $row[2] | $row[3] |
no query
'; } + $content .= '".self::_dump($var,0)."\n";if(self::$showLocation){$trace=debug_backtrace();$i=isset($trace[1]['class'])&&$trace[1]['class']===__CLASS__?1:0;if(isset($trace[$i]['file'],$trace[$i]['line'])){$output=substr_replace($output,' '.htmlspecialchars("in file {$trace[$i]['file']} on line {$trace[$i]['line']}",ENT_NOQUOTES).'',-8,0);}}if(self::$consoleMode){$output=htmlspecialchars_decode(strip_tags($output),ENT_NOQUOTES);}if($return){return$output;}else{echo$output;return$var;}}public static function barDump($var,$title=NULL){if(!self::$productionMode){$dump=array();foreach((is_array($var)?$var:array(''=>$var))as$key=>$val){$dump[$key]=self::dump($val,TRUE);}self::$dumps[]=array('title'=>$title,'dump'=>$dump);}return$var;}private @@ -899,7 +197,7 @@ ReflectionClass($class);$internals[$rc->getFileName()]=TRUE;}}if(class_exists('E _netteDebugPrintCode($file,$line,$count=15){if(function_exists('ini_set')){ini_set('highlight.comment','#999; font-style: italic');ini_set('highlight.default','#000');ini_set('highlight.html','#06b');ini_set('highlight.keyword','#d24; font-weight: bold');ini_set('highlight.string','#080');}$start=max(1,$line-floor($count/2));$source=@file_get_contents($file);if(!$source)return;$source=explode("\n",highlight_string($source,TRUE));$spans=1;echo$source[0];$source=explode('
'.preg_replace_callback('#(^|\s+)?(.*)\((\d+)\) #','_netteDumpCb',$dump).'
';}function
+_netteDump($dump){return''.preg_replace_callback('#(^|\s+)?(.*)\((\d+)\) #','_netteDumpCb',$dump).'
';}function
_netteDumpCb($m){return"$m[1]$m[2]($m[3]) ".(trim($m[1])||$m[3]<7?'▼ ':'► ');}function
_netteOpenPanel($name,$collapsed){static$id;$id++;?>
@@ -925,172 +223,11 @@ FatalErrorException&&isset($errorTypes[$exception->getSeverity()]))?$errorTypes[
-
+
-
+
@@ -1317,9 +454,8 @@ htmlSpecialChars(Framework::REVISION)?>)
-
+