@stucki opened this Issue on May 5th 2020

The system check module reports a problem in the file integrity check:

File integrity check could not be performed due to missing manifest.inc.php.
If you are deploying Matomo from Git, this message is normal.

When running the diagnostics:run command on the CLI, then the warning is a big more verbose:

$ php console diagnostics:run 
File integrity: WARNING File integrity check failed and reported some errors. You should fix this issue and then refresh this page until it shows no error.

File integrity check could not be performed due to missing manifest.inc.php.
If you are deploying Matomo from Git, this message is normal.
1 warnings detected

I'm using Git by intention, therefore I would like to turn off this warning either via config option or automatically when a .git/ folder exists.

@stucki commented on May 5th 2020

The following patch works for me:

diff --git a/core/FileIntegrity.php b/core/FileIntegrity.php
index 49762eb60e..ea40d53b00 100644
--- a/core/FileIntegrity.php
+++ b/core/FileIntegrity.php
@@ -29,6 +29,12 @@ class FileIntegrity

         if (file_exists($manifest)) {
             require_once $manifest;
+        } elseif (is_dir(PIWIK_INCLUDE_PATH . '/.git')) {
+            // Skip file integrity check when Matomo is installed with Git
+            return array(
+                $success = true,
+                $messages
+            );
         }

         if (!class_exists('Piwik\\Manifest')) {
@sgiehl commented on May 5th 2020 Member

Hi @stucki. Thanks for your suggestion. very appreciated. The warning is on purpose, as we don't recommend to install/update Matomo using git.
Nevertheless, there is also a better way to disable that check without manipulating some core code.
You can create a file config\config.php with this content to disable the check:

<?php

return [
    'diagnostics.disabled' => [
        DI\get('Piwik\Plugins\Diagnostics\Diagnostic\FileIntegrityCheck')
    ]
];
@stucki commented on May 5th 2020

Perfect, thank you!

This Issue was closed on May 5th 2020
Powered by GitHub Issue Mirror