Skip to content

Instantly share code, notes, and snippets.

@slivorezka
Created August 27, 2017 19:45
Show Gist options
  • Select an option

  • Save slivorezka/b927788bece43d12e4fb2c3b6dd1a903 to your computer and use it in GitHub Desktop.

Select an option

Save slivorezka/b927788bece43d12e4fb2c3b6dd1a903 to your computer and use it in GitHub Desktop.
Drupal 7 Find broken modules
<?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