1 | <?php namespace Sunspikes\ClamavValidator; |
||
8 | class ClamavValidator extends Validator |
||
9 | { |
||
10 | /** |
||
11 | * @const string CLAMAV_STATUS_OK |
||
12 | */ |
||
13 | const CLAMAV_STATUS_OK = 'OK'; |
||
14 | |||
15 | /** |
||
16 | * @const string CLAMAV_STATUS_ERROR |
||
17 | */ |
||
18 | const CLAMAV_STATUS_ERROR = 'ERROR'; |
||
19 | |||
20 | /** |
||
21 | * @const string CLAMAV_UNIX_SOCKET |
||
22 | */ |
||
23 | const CLAMAV_UNIX_SOCKET = '/var/run/clamav/clamd.ctl'; |
||
24 | |||
25 | /** |
||
26 | * @const string CLAMAV_LOCAL_TCP_SOCKET |
||
27 | */ |
||
28 | 3 | const CLAMAV_LOCAL_TCP_SOCKET = 'tcp://127.0.0.1:3310'; |
|
29 | |||
30 | 3 | /** |
|
31 | 3 | * Creates a new instance of ClamavValidator |
|
32 | */ |
||
33 | public function __construct($translator, $data, $rules, $messages) |
||
37 | |||
38 | /** |
||
39 | * Validate the uploaded file for virus/malware with ClamAV |
||
40 | * |
||
41 | 2 | * @param $attribute string |
|
42 | * @param $value mixed |
||
43 | 2 | * @param $parameters array |
|
44 | 2 | * @return boolean |
|
45 | */ |
||
46 | public function validateClamav($attribute, $value, $parameters) |
||
71 | |||
72 | /** |
||
73 | * Guess the ClamAV socket |
||
74 | 2 | * |
|
75 | * @return string |
||
76 | */ |
||
77 | protected function getClamavSocket() |
||
85 | |||
86 | 2 | /** |
|
87 | * Return the file path from the passed object |
||
88 | * |
||
89 | * @param $file mixed |
||
90 | * @return string |
||
91 | 2 | */ |
|
92 | protected function getFilePath($file) |
||
107 | } |
||
108 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.