You are here

public function SiteAuditReportAbstract::render in Site Audit 8.2

Same name and namespace in other branches
  1. 7 Report/Abstract.php \SiteAuditReportAbstract::render()

Render the report; respects drush options.

File

Report/Abstract.php, line 265
Contains \SiteAudit\Report\Abstract.

Class

SiteAuditReportAbstract
Class SiteAuditReportAbstract.

Code

public function render() {
  if (empty($this->checks)) {
    return;
  }
  if (drush_get_option('html')) {
    $command = drush_get_command();
    if (drush_get_option('bootstrap') && $command['command'] != 'audit_all') {
      echo file_get_contents(SITE_AUDIT_BASE_PATH . '/html/header.html');
    }
    echo $this
      ->toHtml();
    if (drush_get_option('bootstrap') && $command['command'] != 'audit_all') {
      echo file_get_contents(SITE_AUDIT_BASE_PATH . '/html/footer.html');
    }
  }
  elseif (drush_get_option('json')) {
    echo $this
      ->toJson();
  }
  else {
    $this
      ->toDrush();
  }
}