|
@@ -77,7 +77,7 @@ discard block |
|
|
block discarded – undo |
|
77
|
77
|
$path = basename($fullPath); |
|
78
|
78
|
|
|
79
|
79
|
if ($normalizedPath !== $path) { |
|
80
|
|
- $output->writeln("\t<error>Entry \"" . $fullPath . '" will not be accessible due to incompatible encoding</error>'); |
|
|
80
|
+ $output->writeln("\t<error>Entry \"".$fullPath.'" will not be accessible due to incompatible encoding</error>'); |
|
81
|
81
|
} |
|
82
|
82
|
} |
|
83
|
83
|
|
|
@@ -93,7 +93,7 @@ discard block |
|
|
block discarded – undo |
|
93
|
93
|
try { |
|
94
|
94
|
$appData = $appData->get($folder); |
|
95
|
95
|
} catch (NotFoundException $e) { |
|
96
|
|
- $output->writeln('Could not find folder: ' . $folder); |
|
|
96
|
+ $output->writeln('Could not find folder: '.$folder); |
|
97
|
97
|
return; |
|
98
|
98
|
} |
|
99
|
99
|
} |
|
@@ -102,27 +102,27 @@ discard block |
|
|
block discarded – undo |
|
102
|
102
|
$scanner = new \OC\Files\Utils\Scanner(null, $connection, \OC::$server->query(IEventDispatcher::class), \OC::$server->getLogger()); |
|
103
|
103
|
|
|
104
|
104
|
# check on each file/folder if there was a user interrupt (ctrl-c) and throw an exception |
|
105
|
|
- $scanner->listen('\OC\Files\Utils\Scanner', 'scanFile', function ($path) use ($output) { |
|
|
105
|
+ $scanner->listen('\OC\Files\Utils\Scanner', 'scanFile', function($path) use ($output) { |
|
106
|
106
|
$output->writeln("\tFile <info>$path</info>", OutputInterface::VERBOSITY_VERBOSE); |
|
107
|
107
|
++$this->filesCounter; |
|
108
|
108
|
$this->abortIfInterrupted(); |
|
109
|
109
|
}); |
|
110
|
110
|
|
|
111
|
|
- $scanner->listen('\OC\Files\Utils\Scanner', 'scanFolder', function ($path) use ($output) { |
|
|
111
|
+ $scanner->listen('\OC\Files\Utils\Scanner', 'scanFolder', function($path) use ($output) { |
|
112
|
112
|
$output->writeln("\tFolder <info>$path</info>", OutputInterface::VERBOSITY_VERBOSE); |
|
113
|
113
|
++$this->foldersCounter; |
|
114
|
114
|
$this->abortIfInterrupted(); |
|
115
|
115
|
}); |
|
116
|
116
|
|
|
117
|
|
- $scanner->listen('\OC\Files\Utils\Scanner', 'StorageNotAvailable', function (StorageNotAvailableException $e) use ($output) { |
|
118
|
|
- $output->writeln('Error while scanning, storage not available (' . $e->getMessage() . ')', OutputInterface::VERBOSITY_VERBOSE); |
|
|
117
|
+ $scanner->listen('\OC\Files\Utils\Scanner', 'StorageNotAvailable', function(StorageNotAvailableException $e) use ($output) { |
|
|
118
|
+ $output->writeln('Error while scanning, storage not available ('.$e->getMessage().')', OutputInterface::VERBOSITY_VERBOSE); |
|
119
|
119
|
}); |
|
120
|
120
|
|
|
121
|
|
- $scanner->listen('\OC\Files\Utils\Scanner', 'scanFile', function ($path) use ($output) { |
|
|
121
|
+ $scanner->listen('\OC\Files\Utils\Scanner', 'scanFile', function($path) use ($output) { |
|
122
|
122
|
$this->checkScanWarning($path, $output); |
|
123
|
123
|
}); |
|
124
|
124
|
|
|
125
|
|
- $scanner->listen('\OC\Files\Utils\Scanner', 'scanFolder', function ($path) use ($output) { |
|
|
125
|
+ $scanner->listen('\OC\Files\Utils\Scanner', 'scanFolder', function($path) use ($output) { |
|
126
|
126
|
$this->checkScanWarning($path, $output); |
|
127
|
127
|
}); |
|
128
|
128
|
|
|
@@ -135,10 +135,10 @@ discard block |
|
|
block discarded – undo |
|
135
|
135
|
# exit the function if ctrl-c has been pressed |
|
136
|
136
|
$output->writeln('Interrupted by user'); |
|
137
|
137
|
} catch (NotFoundException $e) { |
|
138
|
|
- $output->writeln('<error>Path not found: ' . $e->getMessage() . '</error>'); |
|
|
138
|
+ $output->writeln('<error>Path not found: '.$e->getMessage().'</error>'); |
|
139
|
139
|
} catch (\Exception $e) { |
|
140
|
|
- $output->writeln('<error>Exception during scan: ' . $e->getMessage() . '</error>'); |
|
141
|
|
- $output->writeln('<error>' . $e->getTraceAsString() . '</error>'); |
|
|
140
|
+ $output->writeln('<error>Exception during scan: '.$e->getMessage().'</error>'); |
|
|
141
|
+ $output->writeln('<error>'.$e->getTraceAsString().'</error>'); |
|
142
|
142
|
} |
|
143
|
143
|
} |
|
144
|
144
|
|
|
@@ -237,7 +237,7 @@ discard block |
|
|
block discarded – undo |
|
237
|
237
|
protected function formatExecTime() { |
|
238
|
238
|
$secs = round($this->execTime); |
|
239
|
239
|
# convert seconds into HH:MM:SS form |
|
240
|
|
- return sprintf('%02d:%02d:%02d', ($secs/3600), ($secs/60%60), $secs%60); |
|
|
240
|
+ return sprintf('%02d:%02d:%02d', ($secs / 3600), ($secs / 60 % 60), $secs % 60); |
|
241
|
241
|
} |
|
242
|
242
|
|
|
243
|
243
|
/** |