You are here

public function ExtensionList::getList in Drupal 10

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Extension/ExtensionList.php \Drupal\Core\Extension\ExtensionList::getList()
  2. 9 core/lib/Drupal/Core/Extension/ExtensionList.php \Drupal\Core\Extension\ExtensionList::getList()

Returns all available extensions.

Return value

\Drupal\Core\Extension\Extension[] Processed extension objects, keyed by machine name.

File

core/lib/Drupal/Core/Extension/ExtensionList.php, line 274

Class

ExtensionList
Provides available extensions.

Namespace

Drupal\Core\Extension

Code

public function getList() {
  if ($this->extensions !== NULL) {
    return $this->extensions;
  }
  if ($cache = $this->cache
    ->get($this
    ->getListCacheId())) {
    $this->extensions = $cache->data;
    return $this->extensions;
  }
  $extensions = $this
    ->doList();
  $this->cache
    ->set($this
    ->getListCacheId(), $extensions);
  $this->extensions = $extensions;
  return $this->extensions;
}