1 | <?php |
||
12 | class Local extends \OCA\Files_Antivirus\Scanner{ |
||
13 | |||
14 | /** |
||
15 | * @var string |
||
16 | */ |
||
17 | protected $avPath; |
||
18 | |||
19 | /** |
||
20 | * STDIN and STDOUT descriptors |
||
21 | * @var array of resources |
||
22 | */ |
||
23 | private $pipes = array(); |
||
24 | |||
25 | /** |
||
26 | * Process handle |
||
27 | * @var resource |
||
28 | */ |
||
29 | private $process; |
||
30 | |||
31 | 3 | public function __construct($config){ |
|
32 | 3 | $this->appConfig = $config; |
|
33 | // get the path to the executable |
||
34 | 3 | $this->avPath = escapeshellcmd($this->appConfig->getAvPath()); |
|
35 | |||
36 | // check that the executable is available |
||
37 | 3 | if (!file_exists($this->avPath)) { |
|
38 | 1 | throw new \RuntimeException('The antivirus executable could not be found at '.$this->avPath); |
|
39 | } |
||
40 | 2 | } |
|
41 | |||
42 | 2 | public function initScanner(){ |
|
57 | |||
58 | 2 | protected function shutdownScanner(){ |
|
68 | |||
69 | 2 | protected function getWriteHandle(){ |
|
72 | |||
73 | 2 | protected function prepareChunk($data){ |
|
76 | } |
||
77 |