You are here

public function SiteAuditCheckCacheUsedBackends::getResultInfo in Site Audit 8.2

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

Overrides SiteAuditCheckAbstract::getResultInfo

File

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

Class

SiteAuditCheckCacheUsedBackends
Class SiteAuditCheckCacheUsedBackends.

Code

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