Skip to content

Instantly share code, notes, and snippets.

@webchick
Created October 11, 2012 07:04
Show Gist options
  • Save webchick/3870689 to your computer and use it in GitHub Desktop.
Save webchick/3870689 to your computer and use it in GitHub Desktop.
$enabled_modules = config('system.module')->get('enabled');
$module_files = state()->get('system.module.files');
foreach ($enabled_modules as $name => $weight) {
// Build a list of all enabled modules.
$lists['module_enabled'][$name] = $name;
// Build a list of filenames so drupal_get_filename can use it.
$lists['filepaths'][] = array(
'type' => 'module',
'name' => $name,
'filepath' => $module_files[$name],
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment