You are here

protected function WardenManager::getModuleDetails in Warden 8

Same name and namespace in other branches
  1. 8.2 src/Service/WardenManager.php \Drupal\warden\Service\WardenManager::getModuleDetails()
  2. 3.x src/Service/WardenManager.php \Drupal\warden\Service\WardenManager::getModuleDetails()

Gets an array of the module information that is used on the site.

Parameters

string $module: The name of the module

string $filename: A full path to an info yml file.

Return value

array key is a project name or module name, value is an array of its details.

1 call to WardenManager::getModuleDetails()
WardenManager::generateSiteData in src/Service/WardenManager.php
Generate all the site's data for Warden.

File

src/Service/WardenManager.php, line 253

Class

WardenManager
Default controller for the warden module.

Namespace

Drupal\warden\Service

Code

protected function getModuleDetails($module, $filename) {
  $details = $this
    ->getInfoParser()
    ->parse($filename);
  if (!empty($details['project'])) {
    return [
      $details['project'] => [
        'version' => isset($details['version']) ? $details['version'] : '',
      ],
    ];
  }
  else {
    return [
      $module => [
        'version' => isset($details['version']) ? $details['version'] : '',
      ],
    ];
  }
}