Skip to content

Commit c09d60d

Browse files
committed
Revert commit 581bbff
Causes problems? Just go back until more info. Fixes barryvdh#103 and barryvdh#104
1 parent 3392e3e commit c09d60d

File tree

1 file changed

+12
-20
lines changed

1 file changed

+12
-20
lines changed

src/Barryvdh/Debugbar/LaravelDebugBar.php

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -161,25 +161,21 @@ public function boot(){
161161
$this->addCollector(new MessagesCollector('events'));
162162
$dispatcher = $this->app['events'];
163163
$dispatcher->listen('*', function() use($debugbar, $dispatcher){
164-
if($debugbar->isEnabled()){
165-
if(method_exists($dispatcher, 'firing')){
166-
$event = $dispatcher->firing();
167-
}else{
168-
$args = func_get_args();
169-
$event = end($args);
170-
}
171-
$debugbar['events']->info("Received event: ". $event);
164+
if(method_exists($dispatcher, 'firing')){
165+
$event = $dispatcher->firing();
166+
}else{
167+
$args = func_get_args();
168+
$event = end($args);
172169
}
170+
$debugbar['events']->info("Received event: ". $event);
173171
});
174172
}
175173

176174
if($this->shouldCollect('views', true) and isset($this->app['events'])){
177175
$collectData = $this->app['config']->get('laravel-debugbar::config.options.views.data', true);
178176
$this->addCollector(new ViewCollector($collectData));
179177
$this->app['events']->listen('composing:*', function($view) use($debugbar){
180-
if($debugbar->isEnabled()){
181-
$debugbar['views']->addView($view);
182-
}
178+
$debugbar['views']->addView($view);
183179
});
184180
}
185181

@@ -197,13 +193,11 @@ public function boot(){
197193
$this['messages']->aggregate($logger);
198194
$this->app['log']->listen(function($level, $message, $context) use($debugbar, $logger)
199195
{
200-
if($debugbar->isEnabled()){
201-
if(is_array($message) or is_object($message)){
202-
$message = json_encode($message);
203-
}
204-
$log = '['.date('H:i:s').'] '. "LOG.$level: " . $message . (!empty($context) ? ' '.json_encode($context) : '');
205-
$logger->addMessage($log, $level);
196+
if(is_array($message) or is_object($message)){
197+
$message = json_encode($message);
206198
}
199+
$log = '['.date('H:i:s').'] '. "LOG.$level: " . $message . (!empty($context) ? ' '.json_encode($context) : '');
200+
$logger->addMessage($log, $level);
207201
});
208202
}else{
209203
$this->addCollector(new MonologCollector( $this->app['log']->getMonolog() ));
@@ -227,9 +221,7 @@ public function boot(){
227221

228222
$db->listen(function($query, $bindings, $time, $connectionName) use ($debugbar, $queryCollector)
229223
{
230-
if($debugbar->isEnabled()){
231-
$queryCollector->addQuery($query, $bindings, $time, $connectionName);
232-
}
224+
$queryCollector->addQuery($query, $bindings, $time, $connectionName);
233225
});
234226
}
235227

0 commit comments

Comments
 (0)