Created
June 14, 2017 15:33
-
-
Save Cyclodex/70378e2f3f72a91fc55d2913404fcde0 to your computer and use it in GitHub Desktop.
Drupal cleanup old modules when missing from file system
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Delete {system} records for long-lost modules. | |
*/ | |
function HOOK_update_7100() { | |
$modules = array( | |
'module1', | |
'module2', | |
'module3', | |
); | |
db_delete('system') | |
->condition('name', $modules, 'IN') | |
->condition('type', 'module') | |
->execute(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment