Skip to content
This repository has been archived by the owner on Oct 7, 2023. It is now read-only.

Commit

Permalink
DebugPanel compatible with Nette 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
vojtech-dobes authored and lm committed Nov 3, 2011
1 parent e6064eb commit 0c2bb60
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
12 changes: 6 additions & 6 deletions CouchPhp/Profiling/DebugPanel.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace CouchPhp;

use Nette\IDebugPanel,
Nette\Debug,
use Nette\Diagnostics\IBarPanel,
Nette\Diagnostics\Debugger,
LogicException;


Expand All @@ -15,7 +15,7 @@
/**
* Nette\Debug panel.
*/
class DebugPanel extends Object implements IProfiler, IDebugPanel
class DebugPanel extends Object implements IProfiler, IBarPanel
{
private $connection;

Expand All @@ -27,11 +27,11 @@ class DebugPanel extends Object implements IProfiler, IDebugPanel

public function __construct(Connection $connection)
{
if (class_exists('Nette\Debug', FALSE)) {
Debug::addPanel($this);
if (class_exists('Nette\Diagnostics\Debugger', FALSE)) {
Debugger::$bar->addPanel($this);
} else {
$class = get_called_class();
throw new LogicException("$class requires Nette\\Debug");
throw new LogicException("$class requires Nette\\Diagnostics\\Debugger");
}
$this->connection = $connection;
}
Expand Down
10 changes: 5 additions & 5 deletions CouchPhp/Profiling/DebugPanel.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* @param float $totalTime
* @param array $log
*/
use Nette\Debug, Nette\DebugHelpers, Nette\Json;
use Nette\Diagnostics\Debugger, Nette\Diagnostics\Helpers, Nette\Utils\Json;

$h = function($s) {
return htmlspecialchars($s, ENT_QUOTES);
Expand Down Expand Up @@ -34,14 +34,14 @@ $h = function($s) {
<td colspan="4">
<?php
list($file, $line) = $record[2];
echo Debug::$editor ? "<a href=\"{$h(DebugHelpers::editorLink($file, $line))}\"" : '<span' ?> style="float: right;" title="<?php echo $h($file) . ":$line" ?>">
<?php echo "{$h(basename(dirname($file)) . '/' . basename($file))}:$line" . (Debug::$editor ? '</a>' : '</span>'); ?>
echo Debugger::$editor ? "<a href=\"{$h(Helpers::editorLink($file, $line))}\"" : '<span' ?> style="float: right;" title="<?php echo $h($file) . ":$line" ?>">
<?php echo "{$h(basename(dirname($file)) . '/' . basename($file))}:$line" . (Debugger::$editor ? '</a>' : '</span>'); ?>
<a href="#" class="nette-toggler" rel="#nette-debug-CouchPhp-data-<?php echo $i ?>">Response&nbsp;&#x25ba;</a>
<div class="nette-debug-couchPhp-details-item" id="nette-debug-CouchPhp-data-<?php echo $i ?>">
<?php foreach ($record[1]->headers as $n => $v) {
echo '<b>' . $h($n) . ':</b> ' . $h($v) . '<br />';
}
Debug::dump(Json::decode($record[1]->body)) ?>
Debugger::dump(Json::decode($record[1]->body)) ?>
</div>
</td>
</tr>
Expand All @@ -50,7 +50,7 @@ $h = function($s) {
<td colspan="4">
<a href="#" class="nette-toggler" rel="#nette-debug-CouchPhp-post-<?php echo $i ?>">Post data&nbsp;&#x25ba;</a>
<div class="nette-debug-couchPhp-details-item" id="nette-debug-CouchPhp-post-<?php echo $i ?>">
<?php Debug::dump(Json::decode($record[0]->postData)) ?>
<?php Debugger::dump(Json::decode($record[0]->postData)) ?>
</div>
</td>
</tr>
Expand Down

0 comments on commit 0c2bb60

Please sign in to comment.