public function WatchdogCount::calculateScore in Site Audit 8.3
.
Overrides SiteAuditCheckBase::calculateScore
File
- src/
Plugin/ SiteAuditCheck/ WatchdogCount.php, line 55
Class
- WatchdogCount
- Provides the WatchdogCount Check.
Namespace
Drupal\site_audit\Plugin\SiteAuditCheckCode
public function calculateScore() {
if (!isset($this->registry->watchdog_enabled)) {
$this
->checkInvokeCalculateScore('watchdog_enabled');
}
if (!$this->registry->watchdog_enabled) {
return;
}
$query = \Drupal::database()
->select('watchdog');
$query
->addExpression('COUNT(wid)', 'count');
$this->registry->count_entries = $query
->execute()
->fetchField();
if (!$this->registry->count_entries) {
$this->abort = TRUE;
}
return SiteAuditCheckBase::AUDIT_CHECK_SCORE_INFO;
}