add SQL formatter
This commit is contained in:
parent
b58b674c3a
commit
8df59407d9
@ -3,7 +3,8 @@
|
|||||||
"description": "Returns all SQL queries in the browser.",
|
"description": "Returns all SQL queries in the browser.",
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"require": {
|
"require": {
|
||||||
"monolog/monolog": "^1"
|
"monolog/monolog": "^1",
|
||||||
|
"nilportugues/sql-query-formatter": "^1.2.2"
|
||||||
},
|
},
|
||||||
"license": "GPL-3.0",
|
"license": "GPL-3.0",
|
||||||
"autoload": {
|
"autoload": {
|
||||||
|
@ -42,10 +42,12 @@ class OxidSQLLogger implements SQLLogger
|
|||||||
*/
|
*/
|
||||||
public function startQuery($sql, array $params = null, array $types = null)
|
public function startQuery($sql, array $params = null, array $types = null)
|
||||||
{
|
{
|
||||||
|
$formatter = new Formatter();
|
||||||
|
|
||||||
Monolog\Registry::sql()->addDebug(
|
Monolog\Registry::sql()->addDebug(
|
||||||
$this->message ? $this->message : $sql,
|
$this->message ? $this->message : $sql,
|
||||||
[
|
[
|
||||||
'query' => $sql,
|
'query' => $formatter->format($sql),
|
||||||
'params' => $params,
|
'params' => $params,
|
||||||
'types' => $types,
|
'types' => $types,
|
||||||
'logStartingFile' => $this->logStartingFile,
|
'logStartingFile' => $this->logStartingFile,
|
||||||
|
Loading…
Reference in New Issue
Block a user