You are here

function _get_modules in General Data Protection Regulation 8.2

Same name and namespace in other branches
  1. 8 gdpr.module \_get_modules()
  2. 7 gdpr.module \_get_modules()

Returns cached module data from module info files.

Return value

array Array of module data

2 calls to _get_modules()
_get_gdpr_module_description in ./gdpr.module
Returns a HTML markup for gdpr_modules checkpoint description.
_get_module_list in ./gdpr.module
Returns a HTML markup for data_collecting modules checkpoint description.

File

./gdpr.module, line 441
Module file.

Code

function _get_modules() {
  $cache = Drupal::cache()
    ->get('modules.list');
  if (!empty($cache->data)) {
    return $cache->data;
  }
  $modules_list_raw = Drupal::service('extension.list.module')
    ->getList();
  $modules_list = [];
  foreach ($modules_list_raw as $module) {
    $modules_list[$module
      ->getName()] = [
      'status' => $module->status,
      'name' => $module->info['name'],
    ];
  }
  Drupal::cache()
    ->set('modules.list', $modules_list);
  return $modules_list;
}