1 | <?php |
||
20 | class Item implements IScannable { |
||
21 | /** |
||
22 | * Scanned fileid (optional) |
||
23 | * |
||
24 | * @var int |
||
25 | */ |
||
26 | protected $id; |
||
27 | |||
28 | /** |
||
29 | * File view |
||
30 | * |
||
31 | * @var \OC\Files\View |
||
32 | */ |
||
33 | protected $view; |
||
34 | |||
35 | /** |
||
36 | * Path relative to the view |
||
37 | * |
||
38 | * @var string |
||
39 | */ |
||
40 | protected $path; |
||
41 | |||
42 | /** |
||
43 | * file handle, user to read from the file |
||
44 | * |
||
45 | * @var resource |
||
46 | */ |
||
47 | protected $fileHandle; |
||
48 | |||
49 | /** |
||
50 | * Portion size |
||
51 | * |
||
52 | * @var int |
||
53 | */ |
||
54 | protected $chunkSize; |
||
55 | |||
56 | /** |
||
57 | * Is filesize match the size conditions |
||
58 | * |
||
59 | * @var bool |
||
60 | */ |
||
61 | protected $isValidSize; |
||
62 | |||
63 | /** |
||
64 | * @var IL10N |
||
65 | */ |
||
66 | private $l10n; |
||
67 | |||
68 | 5 | public function __construct(IL10N $l10n, $view, $path, $id = null) { |
|
96 | |||
97 | /** |
||
98 | * Is this file good for scanning? |
||
99 | * |
||
100 | * @return boolean |
||
101 | */ |
||
102 | 3 | public function isValid() { |
|
106 | |||
107 | /** |
||
108 | * Reads a file portion by portion until the very end |
||
109 | * |
||
110 | * @return string|boolean |
||
111 | */ |
||
112 | 3 | public function fread() { |
|
126 | |||
127 | /** |
||
128 | * Action to take if this item is infected |
||
129 | * |
||
130 | * @param Status $status |
||
131 | * @param boolean $isBackground |
||
132 | */ |
||
133 | public function processInfected(Status $status, $isBackground) { |
||
174 | |||
175 | /** |
||
176 | * Action to take if this item status is unclear |
||
177 | * |
||
178 | * @param Status $status |
||
179 | * @param boolean $isBackground |
||
180 | */ |
||
181 | public function processUnchecked(Status $status, $isBackground) { |
||
185 | |||
186 | /** |
||
187 | * Action to take if this item status is not infected |
||
188 | * |
||
189 | * @param Status $status |
||
190 | * @param boolean $isBackground |
||
191 | */ |
||
192 | public function processClean(Status $status, $isBackground) { |
||
218 | |||
219 | /** |
||
220 | * Check if the end of file is reached |
||
221 | * |
||
222 | * @return boolean |
||
223 | */ |
||
224 | 3 | private function feof() { |
|
233 | |||
234 | /** |
||
235 | * Opens a file for reading |
||
236 | * |
||
237 | * @throws \RuntimeException |
||
238 | */ |
||
239 | 3 | private function getFileHandle() { |
|
249 | |||
250 | /** |
||
251 | * @param string $message |
||
252 | */ |
||
253 | 3 | public function logDebug($message) { |
|
259 | |||
260 | /** |
||
261 | * @param string $message |
||
262 | * @param int $id optional |
||
263 | * @param string $path optional |
||
264 | */ |
||
265 | 1 | public function logError($message, $id=null, $path=null) { |
|
276 | } |
||
277 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.