Created
August 27, 2017 19:45
-
-
Save slivorezka/b927788bece43d12e4fb2c3b6dd1a903 to your computer and use it in GitHub Desktop.
Drupal 7 Find broken modules
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
| <?php | |
| $count = 0; | |
| $records = db_select('system', 's') | |
| ->fields('s', array('filename', 'name', 'type', 'status')) | |
| ->execute() | |
| ->fetchAll(); | |
| if (!empty($records)) { | |
| foreach ($records as $record) { | |
| if (!file_exists(DRUPAL_ROOT . DIRECTORY_SEPARATOR . $record->filename)) { | |
| $count++; | |
| $status = $record->status ? '+' : '-'; | |
| dsm($record->type . ':' . ' ' . $record->name . ' ' . '[' . $status . ']'); | |
| } | |
| } | |
| } | |
| dsm($count); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment