function _get_modules in General Data Protection Regulation 8
Same name and namespace in other branches
- 8.2 gdpr.module \_get_modules()
- 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 443 - Module file.
Code
function _get_modules() {
$cache = \Drupal::cache()
->get('modules.list');
if (!empty($cache->data)) {
return $cache->data;
}
else {
$modules_list_raw = system_rebuild_module_data();
$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;
}
}