| <?php |
|
|
| |
| |
| |
| |
| |
| |
|
|
| namespace Piwik\Plugins\CoreUpdater\Diagnostic; |
|
|
| use Piwik\Config\GeneralConfig; |
| use Piwik\Http; |
| use Piwik\Plugins\Diagnostics\Diagnostic\Diagnostic; |
| use Piwik\Plugins\Diagnostics\Diagnostic\DiagnosticResult; |
| use Piwik\Translation\Translator; |
| use Piwik\Url; |
|
|
| |
| |
| |
| class HttpsUpdateCheck implements Diagnostic |
| { |
| |
| |
| |
| private $translator; |
|
|
| public function __construct(Translator $translator) |
| { |
| $this->translator = $translator; |
| } |
|
|
| public function execute() |
| { |
| $faqLink = [ |
| Url::getExternalLinkTag('https://matomo.org/faq/faq-how-to-disable-https-for-matomo-org-and-api-matomo-org-requests'), |
| '</a>', |
| ]; |
| $label = $this->translator->translate('Installation_SystemCheckUpdateHttps'); |
|
|
| if (GeneralConfig::getConfigValue('force_matomo_http_request') == 1) { |
| |
| $comment = $this->translator->translate('Installation_MatomoHttpRequestConfigInfo', $faqLink); |
| return [DiagnosticResult::singleResult($label, DiagnosticResult::STATUS_INFORMATIONAL, $comment)]; |
| } |
|
|
| if (!Http::isUpdatingOverHttps()) { |
| |
| $error = $this->translator->translate('Installation_MatomoHttpsNotSupported', $faqLink); |
| return [DiagnosticResult::singleResult($label, DiagnosticResult::STATUS_ERROR, $error)]; |
| } |
|
|
| |
| return [DiagnosticResult::singleResult($label, DiagnosticResult::STATUS_OK)]; |
| } |
| } |
|
|