Same name and namespace in other branches
- 6.x includes/module.inc \module_exists()
- 7.x includes/module.inc \module_exists()
Determine whether a given module exists.
Parameters
$module: The name of the module (without the .module extension).
Return value
TRUE if the module is both installed and enabled.
3 calls to module_exists()
- block_admin_display in modules/
block/ block.module - Generate main block administration form.
- system_update_1010 in modules/
system/ system.install - theme_block_admin_display in modules/
block/ block.module - Theme main block administration form submission.
File
- includes/
module.inc, line 214 - API for loading and interacting with Drupal modules.
Code
function module_exists($module) {
$list = module_list();
return array_key_exists($module, $list);
}