$indices) {
foreach ($indices as $index) {
$fields = implode(', ', $index['field']);
$html .= "
{$tableName} | {$index['name']} | $fields | ";
}
}
$message = "The following tables have missing indices. Click 'Update Indices' button to create them.
Table Name | Key Name | Expected Indices |
$html
";
$msg = new CRM_Utils_Check_Message(
__FUNCTION__,
ts($message),
ts('Performance warning: Missing indices'),
\Psr\Log\LogLevel::WARNING,
'fa-server'
);
$msg->addAction(
ts('Update Indices'),
ts('Update all database indices now? This may take a few minutes and cause a noticeable performance lag for all users while running.'),
'api3',
array('System', 'updateindexes')
);
$messages[] = $msg;
}
return $messages;
}
/**
* @return array
*/
public function checkMissingLogTables() {
$messages = array();
$logging = new CRM_Logging_Schema();
$missingLogTables = $logging->getMissingLogTables();
if ($missingLogTables) {
$msg = new CRM_Utils_Check_Message(
__FUNCTION__,
ts("You don't have logging enabled on some tables. This may cause errors on performing insert/update operation on them."),
ts('Missing Log Tables'),
\Psr\Log\LogLevel::WARNING,
'fa-server'
);
$msg->addAction(
ts('Create Missing Log Tables'),
ts('Create missing log tables now? This may take few minutes.'),
'api3',
array('System', 'createmissinglogtables')
);
$messages[] = $msg;
}
return $messages;
}
}