Skip to content

Commit 1a9e44d

Browse files
committed
Format SQL queries so they are easier to read.
Use a library to format SQL queries into a more readable formatting. Refs #349
1 parent 10e7a73 commit 1a9e44d

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
"source": "https://github.com/cakephp/debug_kit"
2424
},
2525
"require": {
26-
"cakephp/cakephp": "3.0.*"
26+
"cakephp/cakephp": "3.0.*",
27+
"jdorn/sql-formatter": "~1.2"
2728
},
2829
"require-dev": {
2930
"cakephp/cakephp-codesniffer": "dev-master",

src/Template/Element/sql_log_panel.ctp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ $noOutput = true;
6363
<tbody>
6464
<?php foreach ($queries as $query): ?>
6565
<tr>
66-
<td><?= h($query['query']) ?></td>
66+
<td><pre><?= SqlFormatter::format($query['query'], false) ?></pre></td>
6767
<td><?= h($query['rows']) ?></td>
6868
<td><?= h($query['took']) ?></td>
6969
</tr>

0 commit comments

Comments
 (0)