Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthieu Aubry <mattab@users.noreply.github.com>2016-12-27 12:05:21 +0300
committerGitHub <noreply@github.com>2016-12-27 12:05:21 +0300
commit3ce6d87aa1e8d772fb727413346f8e7426c38706 (patch)
tree6c482bcf80ca998a695345397b0710e696bc1c9c /plugins/Diagnostics/Diagnostic/FileIntegrityCheck.php
parentd1e80dc071780dda8ad7a79e82a4c874d3523d93 (diff)
File integrity checker now reports files found in the filesystem but not expected to be there (#11096)
* File integrity checker now reports files found in the filesystem but not expected to be there fixes #11087 * Move file integrity logic to own class * Fix bug in logic so that third party plugins are not listed * fix up some comments * Also report any hidden files not expected to be there * Issue a warning when file integrity didn't run for any reason. Safer choice * Ui tests
Diffstat (limited to 'plugins/Diagnostics/Diagnostic/FileIntegrityCheck.php')
-rw-r--r--plugins/Diagnostics/Diagnostic/FileIntegrityCheck.php16
1 files changed, 5 insertions, 11 deletions
diff --git a/plugins/Diagnostics/Diagnostic/FileIntegrityCheck.php b/plugins/Diagnostics/Diagnostic/FileIntegrityCheck.php
index 7393877175..e9e58fdd8b 100644
--- a/plugins/Diagnostics/Diagnostic/FileIntegrityCheck.php
+++ b/plugins/Diagnostics/Diagnostic/FileIntegrityCheck.php
@@ -8,7 +8,7 @@
namespace Piwik\Plugins\Diagnostics\Diagnostic;
use Piwik\Development;
-use Piwik\Filechecks;
+use Piwik\FileIntegrity;
use Piwik\Translation\Translator;
/**
@@ -31,22 +31,16 @@ class FileIntegrityCheck implements Diagnostic
$label = $this->translator->translate('Installation_SystemCheckFileIntegrity');
if(Development::isEnabled()) {
- return array(DiagnosticResult::singleResult($label, DiagnosticResult::STATUS_OK));
+ return array(DiagnosticResult::singleResult($label, DiagnosticResult::STATUS_WARNING, '(Disabled in development mode)'));
}
- $messages = Filechecks::getFileIntegrityInformation();
- $ok = array_shift($messages);
-
- if (empty($messages)) {
- return array(DiagnosticResult::singleResult($label, DiagnosticResult::STATUS_OK));
- }
+ list($ok, $messages) = FileIntegrity::getFileIntegrityInformation();
if ($ok) {
- $status = DiagnosticResult::STATUS_WARNING;
- return array(DiagnosticResult::singleResult($label, $status, $messages[0]));
+ return array(DiagnosticResult::singleResult($label, DiagnosticResult::STATUS_OK, implode('<br/>', $messages)));
}
- $comment = $this->translator->translate('General_FileIntegrityWarningExplanation');
+ $comment = $this->translator->translate('General_FileIntegrityWarning');
// Keep only the 20 first lines else it becomes unmanageable
if (count($messages) > 20) {