You are here

public function SiteAuditCheckCacheDefaultBackends::getResultInfo in Site Audit 8.2

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

Overrides SiteAuditCheckAbstract::getResultInfo

File

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

Class

SiteAuditCheckCacheDefaultBackends
Class SiteAuditCheckCacheDefaultBackends.

Code

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