array(REQUIREMENT_OK, 'Consistent', '@count modules with matching tables'),
'extra' => array(REQUIREMENT_OK, 'Extra tables', '@count extra tables'),
'warn' => array(REQUIREMENT_WARNING, 'Warning', '@count warnings'),
'missing' => array(REQUIREMENT_ERROR, 'Inconsistent', '@count module with missing tables'),
'different' => array(REQUIREMENT_ERROR, 'Inconsistent', '@count module with mis-matching tables'),
);
$notes = array();
$severity = REQUIREMENT_OK;
foreach ($checks as $key => $data) {
if (!empty($info[$key])) {
$severity = $data[0];
$status = $data[1];
$notes[] = $t($data[2], array('@count' => count($info[$key])));
}
}
$desc = ''; // if there is only one note, it is for 'same'
if (count($notes) > 1) {
$desc = $t('The Schema comparison report shows: ') . theme('item_list', $notes);
}
if ($severity != REQUIREMENT_OK) {
$sys_reqs = system_requirements($phase);
if ($sys_reqs['update']['severity'] != REQUIREMENT_OK) {
$desc .= $t('You should follow the instructions under @title now or run the database schema comparison report for more details.', array('@title' => $sys_reqs['update']['title'], '@compare' => url('admin/build/schema/compare')));
} else {
$desc .= $t('The database schema comparison report provides more details.', array('@compare' => url('admin/build/schema/compare')));
}
}
$reqs['schema'] = array(
'title' => $t('Database schema'),
'value' => $status,
'severity' => $severity,
'description' => $desc,
);
}
return $reqs;
}
/**
* Implementation of hook_uninstall(),
*/
function schema_uninstall() {
variable_del('schema_status_report');
variable_del('schema_suppress_type_warnings');
}