function DrupalKernel::setExtensionData

Sets extension data to class properties using ExtensionDiscovery.

This function is expensive to call as it scans the filesystem for extensions. Use ::moduleData() and ::themeExtensions() instead.

2 calls to DrupalKernel::setExtensionData()
DrupalKernel::moduleData in core/lib/Drupal/Core/DrupalKernel.php
Returns module data on the filesystem.
DrupalKernel::themeExtensions in core/lib/Drupal/Core/DrupalKernel.php
Returns theme data on the filesystem.

File

core/lib/Drupal/Core/DrupalKernel.php, line 815

Class

DrupalKernel
The DrupalKernel class is the core of Drupal itself.

Namespace

Drupal\Core

Code

private function setExtensionData() : void {
  // First, find profiles.
  $listing = new ExtensionDiscovery($this->root);
  $listing->setProfileDirectories([]);
  $all_profiles = $listing->scan('profile');
  $profiles = array_intersect_key($all_profiles, $this->moduleList);
  $profile_directories = array_map(function (Extension $profile) {
    return $profile->getPath();
  }, $profiles);
  $listing->setProfileDirectories($profile_directories);
  // Now find modules.
  $this->moduleData = $profiles + $listing->scan('module');
  // Now find themes.
  $this->themeExtensions = $listing->scan('theme');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.