You are here

public function SiteAuditCheckCodebaseManagedFileSize::calculateScore in Site Audit 8.2

Same name and namespace in other branches
  1. 7 Check/Codebase/ManagedFileSize.php \SiteAuditCheckCodebaseManagedFileSize::calculateScore()

Implements \SiteAudit\Check\Abstract\calculateScore().

Overrides SiteAuditCheckAbstract::calculateScore

File

Check/Codebase/ManagedFileSize.php, line 63
Contains \SiteAudit\Check\Codebase\ManagedFileSize.

Class

SiteAuditCheckCodebaseManagedFileSize
Class SiteAuditCheckCodebaseManagedFileSize.

Code

public function calculateScore() {
  if (!$this->registry['managed_file_count']) {
    $this->registry['managed_filesize'] = 0;
  }
  else {
    $sql_query = 'SELECT SUM(filesize) ';
    $sql_query .= 'FROM {file_managed} ';
    $sql_query .= 'WHERE status = 1 ';
    $this->registry['managed_filesize'] = db_query($sql_query)
      ->fetchField();
  }
  return SiteAuditCheckAbstract::AUDIT_CHECK_SCORE_INFO;
}