You are here

Count.php in Site Audit 7

Same filename in this branch
  1. 7 Check/Extensions/Count.php
  2. 7 Check/Watchdog/Count.php
  3. 7 Check/Views/Count.php
Same filename and directory in other branches
  1. 8.2 Check/Watchdog/Count.php

Contains \SiteAudit\Check\Watchdog\Count.

File

Check/Watchdog/Count.php
View 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

Namesort descending Description
SiteAuditCheckWatchdogCount Class SiteAuditCheckWatchdogCount.