public function SiteAuditCheckExtensionsCount::calculateScore in Site Audit 8.2
Same name and namespace in other branches
- 7 Check/Extensions/Count.php \SiteAuditCheckExtensionsCount::calculateScore()
Implements \SiteAudit\Check\Abstract\calculateScore().
Overrides SiteAuditCheckAbstract::calculateScore
File
- Check/
Extensions/ Count.php, line 91 - Contains \SiteAudit\Check\Extensions\Count.
Class
- SiteAuditCheckExtensionsCount
- Class SiteAuditCheckExtensionsCount.
Code
public function calculateScore() {
$this->registry['extension_count'] = 0;
$this->registry['extensions'] = drush_get_extensions(FALSE);
foreach ($this->registry['extensions'] as $extension) {
$status = drush_get_extension_status($extension);
if (!in_array($status, array(
'enabled',
))) {
continue;
}
$this->registry['extension_count']++;
}
if ($this->registry['extension_count'] >= drush_get_option('extension_count', 150)) {
return SiteAuditCheckAbstract::AUDIT_CHECK_SCORE_WARN;
}
return SiteAuditCheckAbstract::AUDIT_CHECK_SCORE_PASS;
}