You are here

public function SiteAuditCheckDatabaseEngine::getResultFail in Site Audit 7

Same name and namespace in other branches
  1. 8.2 Check/Database/Engine.php \SiteAuditCheckDatabaseEngine::getResultFail()

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

Overrides SiteAuditCheckAbstract::getResultFail

File

Check/Database/Engine.php, line 29
Contains \SiteAudit\Check\Database\Engine.

Class

SiteAuditCheckDatabaseEngine
Class SiteAuditCheckDatabaseEngine.

Code

public function getResultFail() {
  if (drush_get_option('html')) {
    $ret_val = '<table class="table table-condensed">';
    $ret_val .= '<thead><tr><th>' . dt('Table Name') . '</th><th>' . dt('Engine') . '</th></tr></thead>';
    $ret_val .= '<tbody>';
    foreach ($this->registry['engine_tables'] as $name => $engine) {
      $ret_val .= '<tr>';
      $ret_val .= '<td>' . $name . '</td>';
      $ret_val .= '<td>' . $engine . '</td>';
      $ret_val .= '</tr>';
    }
    $ret_val .= '</tbody>';
    $ret_val .= '</table>';
  }
  else {
    $ret_val = dt('Table Name: Engine') . PHP_EOL;
    if (!drush_get_option('json')) {
      $ret_val .= str_repeat(' ', 4);
    }
    $ret_val .= '---------------------';
    foreach ($this->registry['engine_tables'] as $name => $engine) {
      $ret_val .= PHP_EOL;
      if (!drush_get_option('json')) {
        $ret_val .= str_repeat(' ', 4);
      }
      $ret_val .= "{$name}: {$engine}";
    }
  }
  return $ret_val;
}