Skip to content

Commit

Permalink
Move cache read inside VarDumper handler to avoid cache call during p…
Browse files Browse the repository at this point in the history
…ackage discovery/composer install calls (#1025)
  • Loading branch information
Rihards Ščeredins authored Mar 8, 2021
1 parent 4d4a2f7 commit 897d2e0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Watchers/DumpWatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ public function __construct(CacheFactory $cache, array $options = [])
*/
public function register($app)
{
if (! $this->cache->get('telescope:dump-watcher')) {
return;
}

$htmlDumper = new HtmlDumper();
$htmlDumper->setDumpHeader('');

VarDumper::setHandler(function ($var) use ($htmlDumper) {
if (! $this->cache->get('telescope:dump-watcher')) {
return;
}

$this->recordDump($htmlDumper->dump(
(new VarCloner)->cloneVar($var), true
));
Expand Down

0 comments on commit 897d2e0

Please sign in to comment.