function ExtensionDiscovery::process

Same name in other branches
  1. 9 core/lib/Drupal/Core/Extension/ExtensionDiscovery.php \Drupal\Core\Extension\ExtensionDiscovery::process()
  2. 8.9.x core/lib/Drupal/Core/Extension/ExtensionDiscovery.php \Drupal\Core\Extension\ExtensionDiscovery::process()
  3. 11.x core/lib/Drupal/Core/Extension/ExtensionDiscovery.php \Drupal\Core\Extension\ExtensionDiscovery::process()

Processes the filtered and sorted list of extensions.

Extensions discovered in later search paths override earlier, unless they are not compatible with the current version of Drupal core.

Parameters

\Drupal\Core\Extension\Extension[] $all_files: The sorted list of all extensions that were found.

Return value

\Drupal\Core\Extension\Extension[] The filtered list of extensions, keyed by extension name.

1 call to ExtensionDiscovery::process()
ExtensionDiscovery::scan in core/lib/Drupal/Core/Extension/ExtensionDiscovery.php
Discovers available extensions of a given type.

File

core/lib/Drupal/Core/Extension/ExtensionDiscovery.php, line 378

Class

ExtensionDiscovery
Discovers available extensions in the filesystem.

Namespace

Drupal\Core\Extension

Code

protected function process(array $all_files) {
    $files = [];
    // Duplicate files found in later search directories take precedence over
    // earlier ones; they replace the extension in the existing $files array.
    foreach ($all_files as $file) {
        $files[$file->getName()] = $file;
    }
    return $files;
}

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