diff options
Diffstat (limited to 'core/FileIntegrity.php')
-rw-r--r-- | core/FileIntegrity.php | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/core/FileIntegrity.php b/core/FileIntegrity.php index ee37ca9887..b63d18f1fc 100644 --- a/core/FileIntegrity.php +++ b/core/FileIntegrity.php @@ -79,7 +79,12 @@ class FileIntegrity 'plugins/ImageGraph/fonts/unifont.ttf', 'vendor/autoload.php', 'vendor/composer/autoload_real.php', + 'vendor/szymach/c-pchart/app/*', 'tmp/*', + // Search engine sites verification + 'google*.html', + 'BingSiteAuth.xml', + 'yandex*.html', // Files below are not expected but they used to be present in older Piwik versions and may be still here // As they are not going to cause any trouble we won't report them as 'File to delete' '*.coveralls.yml', @@ -111,8 +116,14 @@ class FileIntegrity $deleteAllAtOnce = array(); $chunks = array_chunk($directories, 50); + $command = 'rm -Rf'; + + if (SettingsServer::isWindows()) { + $command = 'rmdir /s /q'; + } + foreach ($chunks as $directories) { - $deleteAllAtOnce[] = sprintf('rm -Rf %s', implode(' ', $directories)); + $deleteAllAtOnce[] = sprintf('%s %s', $command, implode(' ', $directories)); } $messages[] = Piwik::translate('General_ExceptionUnexpectedDirectory') @@ -153,8 +164,14 @@ class FileIntegrity $deleteAllAtOnce = array(); $chunks = array_chunk($files, 50); + $command = 'rm'; + + if (SettingsServer::isWindows()) { + $command = 'del'; + } + foreach ($chunks as $files) { - $deleteAllAtOnce[] = sprintf('rm %s', implode(' ', $files)); + $deleteAllAtOnce[] = sprintf('%s %s', $command, implode(' ', $files)); } $messages[] = Piwik::translate('General_ExceptionUnexpectedFile') |