Skip to content

Commit 765bffc

Browse files
committed
Dont update config
Should fix config caching + concurrent requests.
1 parent 72acfb1 commit 765bffc

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

src/LaravelDebugbar.php

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,13 @@ class LaravelDebugbar extends DebugBar
7070
*/
7171
protected $booted = false;
7272

73+
/**
74+
* True when enabled, false disabled an null for still unknown
75+
*
76+
* @var bool
77+
*/
78+
protected $enabled = null;
79+
7380
/**
7481
* True when this is a Lumen application
7582
*
@@ -95,7 +102,8 @@ public function __construct($app = null)
95102
*/
96103
public function enable()
97104
{
98-
$this->app['config']->set('debugbar.enabled', true);
105+
$this->enabled = true;
106+
99107
if (!$this->booted) {
100108
$this->boot();
101109
}
@@ -580,10 +588,6 @@ public function modifyResponse(Request $request, Response $response)
580588
}
581589
}
582590

583-
584-
// Stop further rendering (on subrequests etc)
585-
$this->disable();
586-
587591
return $response;
588592
}
589593

@@ -593,7 +597,11 @@ public function modifyResponse(Request $request, Response $response)
593597
*/
594598
public function isEnabled()
595599
{
596-
return value($this->app['config']->get('debugbar.enabled'));
600+
if ($this->enabled === null) {
601+
$this->enabled = value($this->app['config']->get('debugbar.enabled'));
602+
}
603+
604+
return $this->enabled;
597605
}
598606

599607
/**
@@ -697,7 +705,7 @@ public function injectDebugbar(Response $response)
697705
*/
698706
public function disable()
699707
{
700-
$this->app['config']->set('debugbar.enabled', false);
708+
$this->enabled = false;
701709
}
702710

703711
/**

0 commit comments

Comments
 (0)