Skip to content

Commit

Permalink
Merge pull request #118 from Jakub-Fajkus/nette-php-generator
Browse files Browse the repository at this point in the history
PhpGenerator nově používá Dumper namísto helperu
  • Loading branch information
Spamercz committed Mar 18, 2022
2 parents 24344e4 + 40052db commit 5a28197
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"require-dev": {
"nette/bootstrap": "~3.0",
"nette/deprecated": "~3.0",
"nette/php-generator": "~3.0",
"nette/php-generator": "~3.3",
"tracy/tracy": "~2.4",
"slevomat/coding-standard": "dev-master",
"nette/tester": "^2.3.1",
Expand Down
8 changes: 6 additions & 2 deletions src/Kdyby/Redis/Diagnostics/Panel.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,14 @@ public function getPanel(): string

$s = '';
$h = 'htmlSpecialChars';

$dumper = new \Nette\PhpGenerator\Dumper();

foreach ($this->queries as $query) {
$s .= '<tr><td>' . \sprintf('%0.3f', $query->time * 1000000);
$s .= '</td><td class="kdyby-RedisClientPanel-dbindex">' . $query->db;
$s .= '</td><td class="kdyby-RedisClientPanel-cmd">' .
$h(\substr(\Nette\PhpGenerator\Helpers::dump(self::$maxLength ? \substr($query->cmd, 0, self::$maxLength) : $query->cmd), 1, -1));
$h(\substr($dumper->dump(self::$maxLength ? \substr($query->cmd, 0, self::$maxLength) : $query->cmd), 1, -1));
$s .= '</td></tr>';
}

Expand Down Expand Up @@ -183,7 +186,8 @@ public static function renderException($e): ?array
'</span></pre>';
}
if ($e->response) {
$response = \Nette\PhpGenerator\Helpers::dump($e->response);
$dumper = new \Nette\PhpGenerator\Dumper();
$response = $dumper->dump($e->response);
$panel .= '<h3>Redis Response (' . \strlen($e->response) . ')</h3>' .
'<pre class="nette-dump"><span class="php-string">' .
\htmlspecialchars($response) .
Expand Down

0 comments on commit 5a28197

Please sign in to comment.