function ModuleExtensionList::getActiveProfile

Same name in other branches
  1. 9 core/lib/Drupal/Core/Extension/ModuleExtensionList.php \Drupal\Core\Extension\ModuleExtensionList::getActiveProfile()
  2. 8.9.x core/lib/Drupal/Core/Extension/ModuleExtensionList.php \Drupal\Core\Extension\ModuleExtensionList::getActiveProfile()
  3. 10 core/lib/Drupal/Core/Extension/ModuleExtensionList.php \Drupal\Core\Extension\ModuleExtensionList::getActiveProfile()

Gets the processed active profile object, or null.

Return value

\Drupal\Core\Extension\Extension|null The active profile, if there is one.

1 call to ModuleExtensionList::getActiveProfile()
ModuleExtensionList::getExtensionDiscovery in core/lib/Drupal/Core/Extension/ModuleExtensionList.php
Returns the extension discovery.

File

core/lib/Drupal/Core/Extension/ModuleExtensionList.php, line 125

Class

ModuleExtensionList
Provides a list of available modules.

Namespace

Drupal\Core\Extension

Code

protected function getActiveProfile() {
    $profiles = $this->profileList
        ->getList();
    if ($this->installProfile && isset($profiles[$this->installProfile])) {
        return $profiles[$this->installProfile];
    }
    return NULL;
}

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