class AntiVir (View source)

Class to scan for virus

Properties

string $error
string[] $errors
string $output
DoliDB $db

Methods

__construct($db)

Constructor

int
dol_avscan_file(string $file)

Scan a file with antivirus.

string
getCliCommand(string $file)

Get full Command Line to run

Details

__construct($db)

Constructor

@param DoliDB $db Database handler

Parameters

$db

int dol_avscan_file(string $file)

Scan a file with antivirus.

This function runs the command defined in setup. This antivirus command must return 0 if OK. Return also true (virus found) if file end with '.virus' (so we can make test safely).

Parameters

string $file

File to scan

Return Value

int

Return integer <0 if KO (-98 if error, -99 if virus), 0 if OK

string getCliCommand(string $file)

Get full Command Line to run

Parameters

string $file

File to scan

Return Value

string

Full command line to run