CacheBinsAll.php in Site Audit 8.3
File
src/Plugin/SiteAuditCheck/CacheBinsAll.php
View source
<?php
namespace Drupal\site_audit\Plugin\SiteAuditCheck;
use Drupal\site_audit\Plugin\SiteAuditCheckBase;
class CacheBinsAll extends SiteAuditCheckBase {
public function getResultFail() {
}
public function getResultInfo() {
$ret_val = [
'#header' => [
'Bin',
'Class',
],
'#theme' => 'table',
];
foreach ($this->registry->cache_bins_all as $bin => $class) {
$ret_val['#rows'][] = [
$bin,
$class,
];
}
return $ret_val;
}
public function getResultPass() {
}
public function getResultWarn() {
}
public function getAction() {
}
public function calculateScore() {
$container = \Drupal::getContainer();
$services = $container
->getServiceIds();
$this->registry->cache_bins_all = [];
$back_ends = preg_grep('/^cache\\.backend\\./', array_values($services));
foreach ($back_ends as $backend) {
$this->registry->cache_bins_all[$backend] = get_class($container
->get($backend));
}
return SiteAuditCheckBase::AUDIT_CHECK_SCORE_INFO;
}
}