You are here

public function Profiler::add in Devel 8

Same name and namespace in other branches
  1. 8.3 webprofiler/src/Profiler/Profiler.php \Drupal\webprofiler\Profiler\Profiler::add()
  2. 8.2 webprofiler/src/Profiler/Profiler.php \Drupal\webprofiler\Profiler\Profiler::add()
  3. 4.x webprofiler/src/Profiler/Profiler.php \Drupal\webprofiler\Profiler\Profiler::add()

File

webprofiler/src/Profiler/Profiler.php, line 53

Class

Profiler
Class Profiler

Namespace

Drupal\webprofiler\Profiler

Code

public function add(DataCollectorInterface $collector) {

  // drupal collector should not be disabled
  if ($collector
    ->getName() == 'drupal') {
    parent::add($collector);
  }
  else {
    if ($this->activeToolbarItems && array_key_exists($collector
      ->getName(), $this->activeToolbarItems) && $this->activeToolbarItems[$collector
      ->getName()] !== '0') {
      parent::add($collector);
    }
  }
}