function ExtensionList::getPathNames

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

Returns a list of extension file paths keyed by machine name.

Return value

string[]

1 call to ExtensionList::getPathNames()
ExtensionList::getPathname in core/lib/Drupal/Core/Extension/ExtensionList.php
Gets the info file path for an extension.
1 method overrides ExtensionList::getPathNames()
DatabaseDriverList::getPathNames in core/lib/Drupal/Core/Extension/DatabaseDriverList.php
Returns a list of extension file paths keyed by machine name.

File

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

Class

ExtensionList
Provides available extensions.

Namespace

Drupal\Core\Extension

Code

public function getPathNames() {
    if ($this->pathNames === NULL) {
        $cache_id = $this->getPathNamesCacheId();
        $this->pathNames = $this->state
            ->get($cache_id);
        if ($this->pathNames === NULL) {
            $this->pathNames = $this->recalculatePathNames();
            // Store filenames to allow static::getPathname() to retrieve them
            // without having to rebuild or scan the filesystem.
            $this->state
                ->set($cache_id, $this->pathNames);
        }
    }
    return $this->pathNames;
}

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