W3cubDocs

/Drupal 8

protected function DrupalKernel::getModuleNamespacesPsr4

protected DrupalKernel::getModuleNamespacesPsr4($module_file_names)

Gets the PSR-4 base directories for module namespaces.

Parameters

string[] $module_file_names: Array where each key is a module name, and each value is a path to the respective *.info.yml file.

Return value

string[] Array where each key is a module namespace like 'Drupal\system', and each value is the PSR-4 base directory associated with the module namespace.

File

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

Class

DrupalKernel
The DrupalKernel class is the core of Drupal itself.

Namespace

Drupal\Core

Code

protected function getModuleNamespacesPsr4($module_file_names) {
  $namespaces = array();
  foreach ($module_file_names as $module => $filename) {
    $namespaces["Drupal\\$module"] = dirname($filename) . '/src';
  }
  return $namespaces;
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!DrupalKernel.php/function/DrupalKernel::getModuleNamespacesPsr4/8.1.x