| Conditions | 4 |
| Paths | 2 |
| Total Lines | 18 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 24 | public function run($log = true, $terminal = false) |
||
| 25 | { |
||
| 26 | if (Config::get('debugger.queries.debug')) { |
||
| 27 | DB::listen(function ($event) use ($terminal, $log) { |
||
| 28 | $fullQuery = vsprintf(str_replace(['%', '?'], ['%%', '%s'], $event->sql), $event->bindings); |
||
| 29 | |||
| 30 | $text = $event->connectionName . ' (' . $event->time . '): ' . $fullQuery; |
||
| 31 | |||
| 32 | if ($terminal) { |
||
| 33 | dump($text); |
||
| 34 | } |
||
| 35 | |||
| 36 | if ($log) { |
||
| 37 | Log::info($text); |
||
| 38 | } |
||
| 39 | }); |
||
| 40 | } |
||
| 41 | } |
||
| 42 | |||
| 44 |