1 | <?php |
||
15 | class Item implements IScannable{ |
||
16 | /** |
||
17 | * Scanned fileid (optional) |
||
18 | * @var int |
||
19 | */ |
||
20 | protected $id; |
||
21 | |||
22 | /** |
||
23 | * File view |
||
24 | * @var \OC\Files\View |
||
25 | */ |
||
26 | protected $view; |
||
27 | |||
28 | /** |
||
29 | * Path relative to the view |
||
30 | * @var string |
||
31 | */ |
||
32 | protected $path; |
||
33 | |||
34 | /** |
||
35 | * file handle, user to read from the file |
||
36 | * @var resource |
||
37 | */ |
||
38 | protected $fileHandle; |
||
39 | |||
40 | /** |
||
41 | * Portion size |
||
42 | * @var int |
||
43 | */ |
||
44 | protected $chunkSize; |
||
45 | |||
46 | /** |
||
47 | * Is filesize match the size conditions |
||
48 | * @var bool |
||
49 | */ |
||
50 | protected $isValidSize; |
||
51 | |||
52 | /** |
||
53 | * @var IL10N |
||
54 | */ |
||
55 | private $l10n; |
||
56 | |||
57 | 4 | public function __construct(IL10N $l10n, View $view, $path, $id = null) { |
|
84 | |||
85 | /** |
||
86 | * Is this file good for scanning? |
||
87 | * @return boolean |
||
88 | */ |
||
89 | 3 | public function isValid() { |
|
92 | |||
93 | /** |
||
94 | * Reads a file portion by portion until the very end |
||
95 | * @return string|boolean |
||
96 | */ |
||
97 | 3 | public function fread() { |
|
110 | |||
111 | /** |
||
112 | * Action to take if this item is infected |
||
113 | * @param Status $status |
||
114 | * @param boolean $isBackground |
||
115 | */ |
||
116 | public function processInfected(Status $status, $isBackground) { |
||
157 | |||
158 | /** |
||
159 | * Action to take if this item status is unclear |
||
160 | * @param Status $status |
||
161 | * @param boolean $isBackground |
||
162 | */ |
||
163 | public function processUnchecked(Status $status, $isBackground) { |
||
167 | |||
168 | /** |
||
169 | * Action to take if this item status is not infected |
||
170 | * @param Status $status |
||
171 | * @param boolean $isBackground |
||
172 | */ |
||
173 | public function processClean(Status $status, $isBackground) { |
||
193 | |||
194 | /** |
||
195 | * Check if the end of file is reached |
||
196 | * @return boolean |
||
197 | */ |
||
198 | 3 | private function feof() { |
|
207 | |||
208 | /** |
||
209 | * Opens a file for reading |
||
210 | * @throws \RuntimeException |
||
211 | */ |
||
212 | 3 | private function getFileHandle() { |
|
222 | |||
223 | /** |
||
224 | * Delete infected file |
||
225 | */ |
||
226 | private function deleteFile() { |
||
236 | |||
237 | /** |
||
238 | * @param string $message |
||
239 | */ |
||
240 | 3 | public function logDebug($message) { |
|
246 | |||
247 | /** |
||
248 | * @param string $message |
||
249 | * @param int $id optional |
||
250 | * @param string $path optional |
||
251 | */ |
||
252 | 1 | public function logError($message, $id=null, $path=null) { |
|
263 | } |
||
264 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.