Moodle PHP Documentation 4.3
Moodle 4.3.5 (Build: 20240610) (7dcfaa79f78)
core\antivirus\manager Class Reference

Class used for various antivirus related stuff. More...

Static Public Member Functions

static get_antivirus ($antivirusname)
 Returns instance of antivirus.
 
static get_available ()
 Get the list of available antiviruses.
 
static scan_data ($data)
 Scan data steam using all enabled antiviruses, throws exception in case of infected data.
 
static scan_file ($file, $filename, $deleteinfected)
 Scan file using all enabled antiviruses, throws exception in case of infected file.
 
static send_antivirus_messages (\core\antivirus\scanner $antivirus, string $incidentdetails)
 This function puts all relevant information into the messages required, and sends them.
 

Detailed Description

Class used for various antivirus related stuff.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Member Function Documentation

◆ get_antivirus()

static core\antivirus\manager::get_antivirus ( $antivirusname)
static

Returns instance of antivirus.

Parameters
string$antivirusnamename of antivirus.
Return values
object|boolantivirus instance or false if does not exist.

◆ get_available()

static core\antivirus\manager::get_available ( )
static

Get the list of available antiviruses.

Return values
arrayArray ('antivirusname'=>'localised antivirus name').

◆ scan_data()

static core\antivirus\manager::scan_data ( $data)
static

Scan data steam using all enabled antiviruses, throws exception in case of infected data.

Parameters
string$dataThe variable containing the data to scan.
Exceptions
core\antivirus\scanner_exceptionIf data is infected.
Return values
void

◆ scan_file()

static core\antivirus\manager::scan_file ( $file,
$filename,
$deleteinfected )
static

Scan file using all enabled antiviruses, throws exception in case of infected file.

Parameters
string$fileFull path to the file.
string$filenameName of the file (could be different from physical file if temp file is used).
bool$deleteinfectedwhether infected file needs to be deleted.
Exceptions
core\antivirus\scanner_exceptionIf file is infected.
Return values
void

◆ send_antivirus_messages()

static core\antivirus\manager::send_antivirus_messages ( \core\antivirus\scanner $antivirus,
string $incidentdetails )
static

This function puts all relevant information into the messages required, and sends them.

Parameters
core\antivirus\scanner$antivirusthe scanner engine.
string$incidentdetailsdetails of the incident.
Return values
void

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