hook_modules_uninstalled

hook_modules_uninstalled($modules)

Perform necessary actions after modules are uninstalled.

This function differs from hook_uninstall() in that it gives all other modules a chance to perform actions when a module is uninstalled, whereas hook_uninstall() is only called on the module actually being uninstalled.

It is recommended that you implement this hook if your module stores data that may have been set by other modules.

Parameters

$modules: An array of the modules that were uninstalled.

See also

hook_uninstall()

Related topics

Hooks
Define functions that alter the behavior of Drupal core.

File

core/lib/Drupal/Core/Extension/module.api.php, line 262
Hooks related to module and update systems.

Code

function hook_modules_uninstalled($modules) {
  if (in_array('lousy_module', $modules)) {
    \Drupal::state()->delete('mymodule.lousy_module_compatibility');
  }
  mymodule_cache_rebuild();
}
doc_Drupal
2016-10-29 09:18:21
Comments
Leave a Comment

Please login to continue.