You are here

public function SiteAuditCheckCacheBins::getResultInfo in Site Audit 7

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

Overrides SiteAuditCheckAbstract::getResultInfo

File

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

Class

SiteAuditCheckCacheBins
Class SiteAuditCheckCacheBins.

Code

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