public function SiteAuditCheckViewsCacheResults::getAction in Site Audit 7
Same name and namespace in other branches
- 8.2 Check/Views/CacheResults.php \SiteAuditCheckViewsCacheResults::getAction()
Implements \SiteAudit\Check\Abstract\getAction().
Overrides SiteAuditCheckAbstract::getAction
File
- Check/
Views/ CacheResults.php, line 62 - Contains \SiteAudit\Check\Views\CacheResults.
Class
- SiteAuditCheckViewsCacheResults
- Class SiteAuditCheckViewsCacheResults.
Code
public function getAction() {
if (!in_array($this->score, array(
SiteAuditCheckAbstract::AUDIT_CHECK_SCORE_INFO,
SiteAuditCheckAbstract::AUDIT_CHECK_SCORE_PASS,
))) {
$ret_val = dt('Query results should be cached for at least 1 minute.');
if (drush_get_option('detail')) {
$steps = array(
dt('Go to /admin/structure/views/'),
dt('Edit the View in question'),
dt('Select the Display'),
dt('Click Advanced'),
dt('Next to Caching, click to edit.'),
dt('Query results: (something other than Never cache)'),
);
if (drush_get_option('html')) {
$ret_val .= '<ol><li>' . implode('</li><li>', $steps) . '</li></ol>';
}
elseif (drush_get_option('json')) {
$ret_val = array(
'Summary' => $ret_val,
'Steps' => $steps,
);
}
else {
foreach ($steps as $step) {
$ret_val .= PHP_EOL;
$ret_val .= str_repeat(' ', 8);
$ret_val .= '- ' . $step;
}
}
}
return $ret_val;
}
}