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_UNIX_SOCKET |
||
17 | */ |
||
18 | const CLAMAV_UNIX_SOCKET = '/var/run/clamav/clamd.ctl'; |
||
19 | |||
20 | /** |
||
21 | * @const string CLAMAV_LOCAL_TCP_SOCKET |
||
22 | */ |
||
23 | const CLAMAV_LOCAL_TCP_SOCKET = 'tcp://127.0.0.1:3310'; |
||
24 | |||
25 | /** |
||
26 | * Creates a new instance of ClamavValidator |
||
27 | */ |
||
28 | 3 | public function __construct($translator, $data, $rules, $messages) |
|
32 | |||
33 | /** |
||
34 | * Validate the uploaded file for virus/malware with ClamAV |
||
35 | * |
||
36 | * @param $attribute string |
||
37 | * @param $value mixed |
||
38 | * @param $parameters array |
||
39 | * @return boolean |
||
40 | */ |
||
41 | 2 | public function validateClamav($attribute, $value, $parameters) |
|
62 | |||
63 | /** |
||
64 | * Guess the ClamAV socket |
||
65 | * |
||
66 | * @return string |
||
67 | */ |
||
68 | 2 | protected function getClamavSocket() |
|
76 | |||
77 | /** |
||
78 | * Return the file path from the passed object |
||
79 | * |
||
80 | * @param $file mixed |
||
81 | * @return string |
||
82 | */ |
||
83 | 2 | protected function getFilePath($file) |
|
98 | } |
||
99 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.