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
path: root/core
diff options
context:
space:
mode:
authorStefan Giehl <stefan@piwik.org>2017-08-03 08:00:10 +0300
committerMatthieu Aubry <mattab@users.noreply.github.com>2017-08-03 08:00:10 +0300
commit010a5d1e884efafcd67504d7fe1d2c43a06852f3 (patch)
tree4f71c710ad20e3fca767550b1d16a517f099f177 /core
parent7057d18c02d1616e0ae437b984e23463bcc43a73 (diff)
Show windows commands for file integrity check on windows (#11907)
Diffstat (limited to 'core')
-rw-r--r--core/FileIntegrity.php16
1 files changed, 14 insertions, 2 deletions
diff --git a/core/FileIntegrity.php b/core/FileIntegrity.php
index ee37ca9887..f3346380b1 100644
--- a/core/FileIntegrity.php
+++ b/core/FileIntegrity.php
@@ -111,8 +111,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 +159,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')