You are here

public function SiteAuditCheckCacheAllBackends::getResultInfo in Site Audit 8.2

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

Overrides SiteAuditCheckAbstract::getResultInfo

File

Check/Cache/AllBackends.php, line 34
Contains \SiteAudit\Check\Cache\AllBackends.

Class

SiteAuditCheckCacheAllBackends
Class SiteAuditCheckCacheAllBackends.

Code

public function getResultInfo() {
  if (!empty($this->registry['all_backends'])) {
    if (drush_get_option('html')) {
      $ret_val = '<table class="table table-condensed">';
      $ret_val .= '<thead><tr><th>Backend</th><th>Class</th></tr></thead>';
      $ret_val .= '<tbody>';
      foreach ($this->registry['all_backends'] as $backend => $class) {
        $ret_val .= "<tr><td>{$backend}</td><td>{$class}</td></tr>";
      }
      $ret_val .= '</tbody>';
      $ret_val .= '</table>';
    }
    else {
      $ret_val = 'Backend: Class' . PHP_EOL;
      if (!drush_get_option('json')) {
        $ret_val .= str_repeat(' ', 4);
      }
      $ret_val .= '----------';
      foreach ($this->registry['all_backends'] as $backend => $class) {
        $ret_val .= PHP_EOL;
        if (!drush_get_option('json')) {
          $ret_val .= str_repeat(' ', 4);
        }
        $ret_val .= "{$backend}: {$class}";
      }
    }
    return $ret_val;
  }
  else {
    return dt('No cache backend found.');
  }
}