You are here

public function SiteAuditCheckCacheDefaultBackends::calculateScore in Site Audit 8.2

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

Overrides SiteAuditCheckAbstract::calculateScore

File

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

Class

SiteAuditCheckCacheDefaultBackends
Class SiteAuditCheckCacheDefaultBackends.

Code

public function calculateScore() {
  $container = \Drupal::getContainer();
  $defaults = $container
    ->getParameter('cache_default_bin_backends');
  $this->registry['default_backends'] = array();
  foreach ($container
    ->getParameter('cache_bins') as $bin) {
    if (isset($defaults[$bin])) {
      $this->registry['default_backends'][$bin] = $defaults[$bin];
    }
    else {
      $this->registry['default_backends'][$bin] = 'cache.backend.database';
    }
  }
  return SiteAuditCheckAbstract::AUDIT_CHECK_SCORE_INFO;
}