@@ -82,7 +82,7 @@ public function __construct($app = null)
82
82
*/
83
83
public function enable ()
84
84
{
85
- $ this ->app ['config ' ]->set ('laravel- debugbar::config .enabled ' , true );
85
+ $ this ->app ['config ' ]->set ('debugbar.enabled ' , true );
86
86
if (!$ this ->booted ) {
87
87
$ this ->boot ();
88
88
}
@@ -127,7 +127,7 @@ function () use ($debugbar, $startTime) {
127
127
);
128
128
129
129
//Check if App::before is already called..
130
- if ($ this ->checkVersion ( ' 4.1-dev ' , ' >= ' ) && $ this -> app ->isBooted ()) {
130
+ if ($ this ->app ->isBooted ()) {
131
131
$ debugbar ->startMeasure ('application ' , 'Application ' );
132
132
} else {
133
133
$ this ->app ['router ' ]->before (
@@ -151,16 +151,9 @@ function () use ($debugbar) {
151
151
try {
152
152
$ exceptionCollector = new ExceptionsCollector ();
153
153
$ exceptionCollector ->setChainExceptions (
154
- $ this ->app ['config ' ]->get ('laravel- debugbar::config .options.exceptions.chain ' , true )
154
+ $ this ->app ['config ' ]->get ('debugbar.options.exceptions.chain ' , true )
155
155
);
156
156
$ this ->addCollector ($ exceptionCollector );
157
- if ($ this ->checkVersion ('5.0-dev ' , '< ' )) {
158
- $ this ->app ->error (
159
- function (Exception $ exception ) use ($ exceptionCollector ) {
160
- $ exceptionCollector ->addException ($ exception );
161
- }
162
- );
163
- }
164
157
} catch (\Exception $ e ) {
165
158
}
166
159
}
@@ -191,7 +184,7 @@ function (Exception $exception) use ($exceptionCollector) {
191
184
192
185
if ($ this ->shouldCollect ('views ' , true ) and isset ($ this ->app ['events ' ])) {
193
186
try {
194
- $ collectData = $ this ->app ['config ' ]->get ('laravel- debugbar::config .options.views.data ' , true );
187
+ $ collectData = $ this ->app ['config ' ]->get ('debugbar.options.views.data ' , true );
195
188
$ this ->addCollector (new ViewCollector ($ collectData ));
196
189
$ this ->app ['events ' ]->listen (
197
190
'composing:* ' ,
@@ -210,11 +203,7 @@ function ($view) use ($debugbar) {
210
203
211
204
if ($ this ->shouldCollect ('route ' )) {
212
205
try {
213
- if ($ this ->checkVersion ('4.1 ' , '>= ' )) {
214
- $ this ->addCollector ($ this ->app ->make ('Barryvdh\Debugbar\DataCollector\IlluminateRouteCollector ' ));
215
- } else {
216
- $ this ->addCollector ($ this ->app ->make ('Barryvdh\Debugbar\DataCollector\SymfonyRouteCollector ' ));
217
- }
206
+ $ this ->addCollector ($ this ->app ->make ('Barryvdh\Debugbar\DataCollector\IlluminateRouteCollector ' ));
218
207
} catch (\Exception $ e ) {
219
208
$ this ->addException (
220
209
new Exception (
@@ -265,7 +254,7 @@ function ($level, $message, $context) use ($logger) {
265
254
if ($ this ->shouldCollect ('db ' , true ) and isset ($ this ->app ['db ' ])) {
266
255
$ db = $ this ->app ['db ' ];
267
256
if ($ debugbar ->hasCollector ('time ' ) && $ this ->app ['config ' ]->get (
268
- 'laravel- debugbar::config .options.db.timeline ' ,
257
+ 'debugbar.options.db.timeline ' ,
269
258
false
270
259
)
271
260
) {
@@ -275,20 +264,20 @@ function ($level, $message, $context) use ($logger) {
275
264
}
276
265
$ queryCollector = new QueryCollector ($ timeCollector );
277
266
278
- if ($ this ->app ['config ' ]->get ('laravel- debugbar::config .options.db.with_params ' )) {
267
+ if ($ this ->app ['config ' ]->get ('debugbar.options.db.with_params ' )) {
279
268
$ queryCollector ->setRenderSqlWithParams (true );
280
269
}
281
270
282
- if ($ this ->app ['config ' ]->get ('laravel- debugbar::config .options.db.backtrace ' )) {
271
+ if ($ this ->app ['config ' ]->get ('debugbar.options.db.backtrace ' )) {
283
272
$ queryCollector ->setFindSource (true );
284
273
}
285
274
286
- if ($ this ->app ['config ' ]->get ('laravel- debugbar::config .options.db.explain.enabled ' )) {
287
- $ types = $ this ->app ['config ' ]->get ('laravel- debugbar::config .options.db.explain.types ' );
275
+ if ($ this ->app ['config ' ]->get ('debugbar.options.db.explain.enabled ' )) {
276
+ $ types = $ this ->app ['config ' ]->get ('debugbar.options.db.explain.types ' );
288
277
$ queryCollector ->setExplainSource (true , $ types );
289
278
}
290
279
291
- if ($ this ->app ['config ' ]->get ('laravel- debugbar::config .options.db.hints ' , true )) {
280
+ if ($ this ->app ['config ' ]->get ('debugbar.options.db.hints ' , true )) {
292
281
$ queryCollector ->setShowHints (true );
293
282
}
294
283
@@ -316,7 +305,7 @@ function ($query, $bindings, $time, $connectionName) use ($db, $queryCollector)
316
305
try {
317
306
$ mailer = $ this ->app ['mailer ' ]->getSwiftMailer ();
318
307
$ this ->addCollector (new SwiftMailCollector ($ mailer ));
319
- if ($ this ->app ['config ' ]->get ('laravel- debugbar::config .options.mail.full_log ' ) and $ this ->hasCollector (
308
+ if ($ this ->app ['config ' ]->get ('debugbar.options.mail.full_log ' ) and $ this ->hasCollector (
320
309
'messages '
321
310
)
322
311
) {
@@ -333,7 +322,7 @@ function ($query, $bindings, $time, $connectionName) use ($db, $queryCollector)
333
322
334
323
if ($ this ->shouldCollect ('logs ' , false )) {
335
324
try {
336
- $ file = $ this ->app ['config ' ]->get ('laravel- debugbar::config .options.logs.file ' );
325
+ $ file = $ this ->app ['config ' ]->get ('debugbar.options.logs.file ' );
337
326
$ this ->addCollector (new LogsCollector ($ file ));
338
327
} catch (\Exception $ e ) {
339
328
$ this ->addException (
@@ -351,7 +340,7 @@ function ($query, $bindings, $time, $connectionName) use ($db, $queryCollector)
351
340
try {
352
341
$ authCollector = new AuthCollector ($ app ['auth ' ]);
353
342
$ authCollector ->setShowName (
354
- $ this ->app ['config ' ]->get ('laravel- debugbar::config .options.auth.show_name ' )
343
+ $ this ->app ['config ' ]->get ('debugbar.options.auth.show_name ' )
355
344
);
356
345
$ this ->addCollector ($ authCollector );
357
346
} catch (\Exception $ e ) {
@@ -364,15 +353,15 @@ function ($query, $bindings, $time, $connectionName) use ($db, $queryCollector)
364
353
}
365
354
366
355
$ renderer = $ this ->getJavascriptRenderer ();
367
- $ renderer ->setIncludeVendors ($ this ->app ['config ' ]->get ('laravel- debugbar::config .include_vendors ' , true ));
368
- $ renderer ->setBindAjaxHandlerToXHR ($ app ['config ' ]->get ('laravel- debugbar::config .capture_ajax ' , true ));
356
+ $ renderer ->setIncludeVendors ($ this ->app ['config ' ]->get ('debugbar.include_vendors ' , true ));
357
+ $ renderer ->setBindAjaxHandlerToXHR ($ app ['config ' ]->get ('debugbar.capture_ajax ' , true ));
369
358
370
359
$ this ->booted = true ;
371
360
}
372
361
373
362
public function shouldCollect ($ name , $ default = false )
374
363
{
375
- return $ this ->app ['config ' ]->get ('laravel- debugbar::config .collectors. ' . $ name , $ default );
364
+ return $ this ->app ['config ' ]->get ('debugbar.collectors. ' . $ name , $ default );
376
365
}
377
366
378
367
/**
@@ -509,7 +498,7 @@ public function modifyResponse($request, $response)
509
498
}
510
499
} elseif (
511
500
($ request ->isXmlHttpRequest () || $ request ->wantsJson ()) and
512
- $ app ['config ' ]->get ('laravel- debugbar::config .capture_ajax ' , true )
501
+ $ app ['config ' ]->get ('debugbar.capture_ajax ' , true )
513
502
) {
514
503
try {
515
504
$ this ->sendDataInHeaders (true );
@@ -527,7 +516,7 @@ public function modifyResponse($request, $response)
527
516
} catch (\Exception $ e ) {
528
517
$ app ['log ' ]->error ('Debugbar exception: ' . $ e ->getMessage ());
529
518
}
530
- } elseif ($ app ['config ' ]->get ('laravel- debugbar::config .inject ' , true )) {
519
+ } elseif ($ app ['config ' ]->get ('debugbar.inject ' , true )) {
531
520
try {
532
521
$ this ->injectDebugbar ($ response );
533
522
} catch (\Exception $ e ) {
@@ -547,7 +536,7 @@ public function modifyResponse($request, $response)
547
536
*/
548
537
public function isEnabled ()
549
538
{
550
- return value ($ this ->app ['config ' ]->get ('laravel- debugbar::config .enabled ' ));
539
+ return value ($ this ->app ['config ' ]->get ('debugbar.enabled ' ));
551
540
}
552
541
553
542
/**
@@ -635,7 +624,7 @@ public function injectDebugbar(Response $response)
635
624
*/
636
625
public function disable ()
637
626
{
638
- $ this ->app ['config ' ]->set ('laravel- debugbar::config .enabled ' , false );
627
+ $ this ->app ['config ' ]->set ('debugbar.enabled ' , false );
639
628
}
640
629
641
630
/**
@@ -764,23 +753,23 @@ protected function checkVersion($version, $operator = ">=")
764
753
protected function selectStorage (DebugBar $ debugbar )
765
754
{
766
755
$ config = $ this ->app ['config ' ];
767
- if ($ config ->get ('laravel- debugbar::config .storage.enabled ' )) {
768
- $ driver = $ config ->get ('laravel- debugbar::config .storage.driver ' , 'file ' );
756
+ if ($ config ->get ('debugbar.storage.enabled ' )) {
757
+ $ driver = $ config ->get ('debugbar.storage.driver ' , 'file ' );
769
758
770
759
switch ($ driver ) {
771
760
case 'pdo ' :
772
- $ connection = $ config ->get ('laravel- debugbar::config .storage.connection ' );
761
+ $ connection = $ config ->get ('debugbar.storage.connection ' );
773
762
$ table = $ this ->app ['db ' ]->getTablePrefix () . 'phpdebugbar ' ;
774
763
$ pdo = $ this ->app ['db ' ]->connection ($ connection )->getPdo ();
775
764
$ storage = new PdoStorage ($ pdo , $ table );
776
765
break ;
777
766
case 'redis ' :
778
- $ connection = $ config ->get ('laravel- debugbar::config .storage.connection ' );
767
+ $ connection = $ config ->get ('debugbar.storage.connection ' );
779
768
$ storage = new RedisStorage ($ this ->app ['redis ' ]->connection ($ connection ));
780
769
break ;
781
770
case 'file ' :
782
771
default :
783
- $ path = $ config ->get ('laravel- debugbar::config .storage.path ' );
772
+ $ path = $ config ->get ('debugbar.storage.path ' );
784
773
$ storage = new FilesystemStorage ($ this ->app ['files ' ], $ path );
785
774
break ;
786
775
}
0 commit comments