protected function DrupalKernel::moduleData

Returns module data on the filesystem.

Parameters

$module: The name of the module.

Return value

\stdClass|bool Returns a stdClass object if the module data is found containing at least an uri property with the module path, for example core/modules/user/user.module.

1 call to DrupalKernel::moduleData()
DrupalKernel::getModuleFileNames in drupal/core/lib/Drupal/Core/DrupalKernel.php
Returns the file name for each enabled module.

File

drupal/core/lib/Drupal/Core/DrupalKernel.php, line 239
Definition of Drupal\Core\DrupalKernel.

Class

DrupalKernel
The DrupalKernel class is the core of Drupal itself.

Namespace

Drupal\Core

Code

protected function moduleData($module) {
  if (!$this->moduleData) {

    // First, find profiles.
    $profiles_scanner = new SystemListing();
    $all_profiles = $profiles_scanner
      ->scan('/^' . DRUPAL_PHP_FUNCTION_PATTERN . '\\.profile$/', 'profiles');
    $profiles = array_keys(array_intersect_key($this->moduleList, $all_profiles));

    // If a module is within a profile directory but specifies another
    // profile for testing, it needs to be found in the parent profile.
    if (($parent_profile_config = $this->configStorage
      ->read('simpletest.settings')) && isset($parent_profile_config['parent_profile']) && $parent_profile_config['parent_profile'] != $profiles[0]) {

      // In case both profile directories contain the same extension, the
      // actual profile always has precedence.
      array_unshift($profiles, $parent_profile_config['parent_profile']);
    }

    // Now find modules.
    $modules_scanner = new SystemListing($profiles);
    $this->moduleData = $all_profiles + $modules_scanner
      ->scan('/^' . DRUPAL_PHP_FUNCTION_PATTERN . '\\.module$/', 'modules');
  }
  return isset($this->moduleData[$module]) ? $this->moduleData[$module] : FALSE;
}