Skip to content

Commit

Permalink
Toolbar - Make it possible to turn off var data collection
Browse files Browse the repository at this point in the history
  • Loading branch information
najdanovicivan committed Nov 8, 2021
1 parent 3fe0214 commit 7876f92
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
12 changes: 12 additions & 0 deletions app/Config/Toolbar.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,18 @@ class Toolbar extends BaseConfig
Events::class,
];

/**
* --------------------------------------------------------------------------
* Collect Var Data
* --------------------------------------------------------------------------
*
* If set to false var data from the views will not be colleted. Usefull to
* avoid high memory usage when there are lots of data passed to the view.
*
* @var bool
*/
public $collectVarData = true;

/**
* --------------------------------------------------------------------------
* Max History
Expand Down
4 changes: 4 additions & 0 deletions system/Debug/Toolbar.php
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,10 @@ protected function structureTimelineData(array $elements): array
*/
protected function collectVarData(): array
{
if (! $this->config->collectVarData) {
return [];
}

$data = [];

foreach ($this->collectors as $collector) {
Expand Down

0 comments on commit 7876f92

Please sign in to comment.