dolibarr 21.0.0-alpha
AntiVir Class Reference

Class to scan for virus. More...

Public Member Functions

 __construct ($db)
 Constructor.
 
 dol_avscan_file ($file)
 Scan a file with antivirus.
 
 getCliCommand ($file)
 Get full Command Line to run.
 

Detailed Description

Class to scan for virus.

Definition at line 31 of file antivir.class.php.

Constructor & Destructor Documentation

◆ __construct()

AntiVir::__construct ( $db)

Constructor.

Parameters
DoliDB$dbDatabase handler

Definition at line 58 of file antivir.class.php.

Member Function Documentation

◆ dol_avscan_file()

AntiVir::dol_avscan_file ( $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$fileFile to scan
Returns
int Return integer <0 if KO (-98 if error, -99 if virus), 0 if OK

Definition at line 72 of file antivir.class.php.

References dol_syslog(), and getCliCommand().

◆ getCliCommand()

AntiVir::getCliCommand ( $file)

Get full Command Line to run.

Parameters
string$fileFile to scan
Returns
string Full command line to run

Definition at line 130 of file antivir.class.php.

References dol_sanitizePathName(), dol_string_nospecial(), and getDolGlobalString().

Referenced by dol_avscan_file().


The documentation for this class was generated from the following file: