function DrupalKernel::getExtensionsParameter

Returns an array of Extension class parameters for all enabled extensions.

Parameters

array $extension_list: The list of extensions to return filenames for.

callable $get_data: The method to get data for the extension type.

Return value

array An associated array of extension class parameters, keyed by extension name, for all enabled themes.

2 calls to DrupalKernel::getExtensionsParameter()
DrupalKernel::compileContainer in core/lib/Drupal/Core/DrupalKernel.php
Compiles a new service container.
DrupalKernel::getModulesParameter in core/lib/Drupal/Core/DrupalKernel.php
Returns an array of Extension class parameters for all enabled modules.

File

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

Class

DrupalKernel
The DrupalKernel class is the core of Drupal itself.

Namespace

Drupal\Core

Code

protected function getExtensionsParameter(array $extension_list, callable $get_data) : array {
  $extensions = [];
  foreach ($extension_list as $extension => $weight) {
    if ($data = $get_data($extension)) {
      $extensions[$extension] = [
        'type' => $data->getType(),
        'pathname' => $data->getPathname(),
        'filename' => $data->getExtensionFilename(),
      ];
    }
  }
  return $extensions;
}

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