| @@ 374-381 (lines=8) @@ | ||
| 371 | if ($this->detectLaravelVersion(['5.0', '5.1'])) |
|
| 372 | { |
|
| 373 | // $this->events->fire('illuminate.query', [$query, $bindings, $time, $this->getName()]); |
|
| 374 | $this->app['events']->listen('illuminate.query', function($query, $bindings, $time) |
|
| 375 | { |
|
| 376 | $this->app['understand.dataCollector']->setInArray('sql_queries', [ |
|
| 377 | 'query' => $query, |
|
| 378 | 'bindings' => $bindings, |
|
| 379 | 'time' => $time, |
|
| 380 | ]); |
|
| 381 | }); |
|
| 382 | } |
|
| 383 | else |
|
| 384 | { |
|
| @@ 386-393 (lines=8) @@ | ||
| 383 | else |
|
| 384 | { |
|
| 385 | // https://laravel.com/api/5.3/Illuminate/Database/Events/QueryExecuted.html |
|
| 386 | $this->app['events']->listen('Illuminate\Database\Events\QueryExecuted', function($event) |
|
| 387 | { |
|
| 388 | $this->app['understand.dataCollector']->setInArray('sql_queries', [ |
|
| 389 | 'query' => $event->sql, |
|
| 390 | 'bindings' => $event->bindings, |
|
| 391 | 'time' => $event->time, |
|
| 392 | ]); |
|
| 393 | }); |
|
| 394 | } |
|
| 395 | } |
|
| 396 | ||