Count.php in Site Audit 8.2
Same filename in this branch
Same filename and directory in other branches
Contains \SiteAudit\Check\Watchdog\Count.
File
Check/Watchdog/Count.phpView source
<?php
/**
* @file
* Contains \SiteAudit\Check\Watchdog\Count.
*/
/**
* Class SiteAuditCheckWatchdogCount.
*/
class SiteAuditCheckWatchdogCount extends SiteAuditCheckAbstract {
/**
* Implements \SiteAudit\Check\Abstract\getLabel().
*/
public function getLabel() {
return dt('Count');
}
/**
* Implements \SiteAudit\Check\Abstract\getDescription().
*/
public function getDescription() {
return dt('Number of dblog entries.');
}
/**
* Implements \SiteAudit\Check\Abstract\getResultFail().
*/
public function getResultFail() {
}
/**
* Implements \SiteAudit\Check\Abstract\getResultInfo().
*/
public function getResultInfo() {
if (!$this->registry['count_entries']) {
return dt('There are no dblog entries.');
}
return dt('There are @count_entries log entries.', array(
'@count_entries' => number_format($this->registry['count_entries']),
));
}
/**
* Implements \SiteAudit\Check\Abstract\getResultPass().
*/
public function getResultPass() {
}
/**
* Implements \SiteAudit\Check\Abstract\getResultWarn().
*/
public function getResultWarn() {
}
/**
* Implements \SiteAudit\Check\Abstract\getAction().
*/
public function getAction() {
}
/**
* Implements \SiteAudit\Check\Abstract\calculateScore().
*/
public function calculateScore() {
$sql_query = 'SELECT COUNT(wid) ';
$sql_query .= 'FROM {watchdog} ';
$this->registry['count_entries'] = db_query($sql_query)
->fetchField();
if (!$this->registry['count_entries']) {
$this->abort = TRUE;
}
return SiteAuditCheckAbstract::AUDIT_CHECK_SCORE_INFO;
}
}
Classes
Name | Description |
---|---|
SiteAuditCheckWatchdogCount | Class SiteAuditCheckWatchdogCount. |