You are here

function hook_modules_uninstalled in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/Extension/module.api.php \hook_modules_uninstalled()

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

5 functions implement hook_modules_uninstalled()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

language_modules_uninstalled in core/modules/language/language.module
Implements hook_modules_uninstalled().
module_test_modules_uninstalled in core/modules/system/tests/modules/module_test/module_test.module
Implements hook_modules_uninstalled().
node_modules_uninstalled in core/modules/node/node.module
Implements hook_modules_uninstalled().
system_test_modules_uninstalled in core/modules/system/tests/modules/system_test/system_test.module
Implements hook_modules_uninstalled().
user_modules_uninstalled in core/modules/user/user.module
Implements hook_modules_uninstalled().
1 invocation of hook_modules_uninstalled()
ModuleInstaller::uninstall in core/lib/Drupal/Core/Extension/ModuleInstaller.php
Uninstalls a given list of modules.

File

core/lib/Drupal/Core/Extension/module.api.php, line 256
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();
}