13 July 2015

Snippet shows how to uninstall modules programmatically. This is not deleting the files, but doing a full uninstall.

Source code viewer
  1. /**
  2.  * Implements hook_uninstall().
  3.  */
  4. function HOOK_uninstall() {
  5. $modules = array(
  6. 'modules',
  7. 'machine',
  8. 'name',
  9. 'array',
  10. );
  11. module_disable($modules);
  12. drupal_uninstall_modules($modules);
  13. }
Programming Language: PHP