localStorage = $storage; $this->localLogger = $logger; $this->config = $config; $this->activeToolbarItems = $this->config->get('webprofiler.config') ->get('active_toolbar_items'); } /** * {@inheritdoc} */ 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); } } } /** * @param \Symfony\Component\HttpKernel\Profiler\Profile $profile * * @return bool */ public function updateProfile(Profile $profile) { if (!($ret = $this->localStorage->write($profile)) && NULL !== $this->localLogger) { $this->localLogger->warning('Unable to store the profiler information.'); } return $ret; } }