1 | <?php |
||
15 | class Item implements IScannable{ |
||
16 | /** |
||
17 | * Scanned fileid (optional) |
||
18 | * |
||
19 | * @var int |
||
20 | */ |
||
21 | protected $id; |
||
22 | |||
23 | /** |
||
24 | * File view |
||
25 | * |
||
26 | * @var \OC\Files\View |
||
27 | */ |
||
28 | protected $view; |
||
29 | |||
30 | /** |
||
31 | * Path relative to the view |
||
32 | * |
||
33 | * @var string |
||
34 | */ |
||
35 | protected $path; |
||
36 | |||
37 | /** |
||
38 | * file handle, user to read from the file |
||
39 | * |
||
40 | * @var resource |
||
41 | */ |
||
42 | protected $fileHandle; |
||
43 | |||
44 | /** |
||
45 | * Portion size |
||
46 | * |
||
47 | * @var int |
||
48 | */ |
||
49 | protected $chunkSize; |
||
50 | |||
51 | /** |
||
52 | * Is filesize match the size conditions |
||
53 | * |
||
54 | * @var bool |
||
55 | */ |
||
56 | protected $isValidSize; |
||
57 | |||
58 | /** |
||
59 | * @var IL10N |
||
60 | */ |
||
61 | private $l10n; |
||
62 | |||
63 | 5 | public function __construct(IL10N $l10n, $view, $path, $id = null) { |
|
91 | |||
92 | /** |
||
93 | * Is this file good for scanning? |
||
94 | * |
||
95 | * @return boolean |
||
96 | */ |
||
97 | 3 | public function isValid() { |
|
101 | |||
102 | /** |
||
103 | * Reads a file portion by portion until the very end |
||
104 | * |
||
105 | * @return string|boolean |
||
106 | */ |
||
107 | 3 | public function fread() { |
|
121 | |||
122 | /** |
||
123 | * Action to take if this item is infected |
||
124 | * |
||
125 | * @param Status $status |
||
126 | * @param boolean $isBackground |
||
127 | */ |
||
128 | public function processInfected(Status $status, $isBackground) { |
||
169 | |||
170 | /** |
||
171 | * Action to take if this item status is unclear |
||
172 | * |
||
173 | * @param Status $status |
||
174 | * @param boolean $isBackground |
||
175 | */ |
||
176 | public function processUnchecked(Status $status, $isBackground) { |
||
180 | |||
181 | /** |
||
182 | * Action to take if this item status is not infected |
||
183 | * |
||
184 | * @param Status $status |
||
185 | * @param boolean $isBackground |
||
186 | */ |
||
187 | public function processClean(Status $status, $isBackground) { |
||
213 | |||
214 | /** |
||
215 | * Check if the end of file is reached |
||
216 | * |
||
217 | * @return boolean |
||
218 | */ |
||
219 | 3 | private function feof() { |
|
228 | |||
229 | /** |
||
230 | * Opens a file for reading |
||
231 | * |
||
232 | * @throws \RuntimeException |
||
233 | */ |
||
234 | 3 | private function getFileHandle() { |
|
244 | |||
245 | /** |
||
246 | * @param string $message |
||
247 | */ |
||
248 | 3 | public function logDebug($message) { |
|
254 | |||
255 | /** |
||
256 | * @param string $message |
||
257 | * @param int $id optional |
||
258 | * @param string $path optional |
||
259 | */ |
||
260 | 1 | public function logError($message, $id=null, $path=null) { |
|
271 | } |
||
272 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.