|
static | scan (string $path) |
|
Abstraction for checking files with an external virus scanner. Supports connections via TCP or socket and is focused on using ClamAV at the moment. Derived from https://github.com/nextcloud/files_antivirus
- Author
- Thomas Hackl hackl.nosp@m.@dat.nosp@m.a-que.nosp@m.st.d.nosp@m.e
-
Sebastian Biller s.bil.nosp@m.ler@.nosp@m.tu-br.nosp@m.auns.nosp@m.chwei.nosp@m.g.de GPL 2 or later
- Since
- 5.3
Finalized constructor so that the instantition in scan() will never fail.
Establishes a connection to virus scanner via socket or TCP, depending on Stud.IP configuration.
- Returns
- resource|null
All file chunks have been sent: we now signal the end of the stream by sending a "0". Afterwarda, the response we got from virus scanner is parsed and (in case something was found) the name of the virus is returned.
- Parameters
-
- Returns
- array
Get contents of the file to scan.
- Parameters
-
- Returns
- resource
static scan |
( |
string |
$path | ) |
|
|
static |
Scans the given path for viruses.
- Parameters
-
- Returns
- array Contains the found virus signature, error message or is an empty array on successful scan
sendContent |
( |
|
$handle, |
|
|
string |
$content |
|
) |
| |
|
protected |
Send some content to the virus scanner.
- Parameters
-
resource | $handle | |
string | $content | |
- Returns
- int
const SCANRESULT_CLEAN = 0 |
const SCANRESULT_INFECTED = 1 |
const SCANRESULT_UNCHECKED = -1 |
The documentation for this class was generated from the following file: