BestPracticesSites.php in Site Audit 8.3
File
src/Plugin/SiteAuditCheck/BestPracticesSites.php
View source
<?php
namespace Drupal\site_audit\Plugin\SiteAuditCheck;
use Drupal\site_audit\Plugin\SiteAuditCheckBase;
class BestPracticesSites extends SiteAuditCheckBase {
public function getResultFail() {
}
public function getResultInfo() {
}
public function getResultPass() {
if ($this->registry->multisite_enabled) {
return $this
->t('sites.php is not a symbolic link.');
}
else {
return $this
->t('sites.php does not exist.');
}
}
public function getResultWarn() {
return $this
->t('sites/sites.php is a symbolic link.');
}
public function getAction() {
if ($this->score == SiteAuditCheckBase::AUDIT_CHECK_SCORE_WARN) {
return $this
->t('Don\'t rely on symbolic links for core configuration files; copy sites.php where it should be and remove the symbolic link.');
}
}
public function calculateScore() {
$this->registry->multisite_enabled = file_exists(DRUPAL_ROOT . '/sites/sites.php');
if ($this->registry->multisite_enabled && is_link(DRUPAL_ROOT . '/sites/sites.php')) {
return SiteAuditCheckBase::AUDIT_CHECK_SCORE_WARN;
}
return SiteAuditCheckBase::AUDIT_CHECK_SCORE_PASS;
}
}