You are here

public function ExtensionDataCollector::collect in Devel 8

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

File

webprofiler/src/DataCollector/ExtensionDataCollector.php, line 61

Class

ExtensionDataCollector
Defines a data collector for the extension system.

Namespace

Drupal\webprofiler\DataCollector

Code

public function collect(Request $request, Response $response, \Exception $exception = NULL) {
  $modules = $this->moduleHandler
    ->getModuleList();
  $themes = $this->themeHandler
    ->listInfo();
  $this->data['drupal_extension']['count'] = count($modules) + count($themes);
  $this->data['drupal_extension']['modules'] = $modules;
  $this->data['drupal_extension']['themes'] = $themes;
  $this->data['drupal_extension']['installation_path'] = $this->root . '/';
}