Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
core\antivirus\quarantine Class Reference

Quarantine file. More...

Static Public Member Functions

static clean_up_quarantine_folder (int $timetocleanup)
 Clean up quarantine folder.
 
static delete_quarantined_file (int $fileid)
 Delete quarantined file.
 
static download_all_quarantined_files ()
 Download all quarantined files.
 
static download_quarantined_file (int $fileid)
 Download quarantined file.
 
static get_quarantined_files ()
 Return array of quarantined files.
 
static is_quarantine_enabled ()
 Check if the virus quarantine is allowed.
 
static quarantine_data (string $data, string $filename, string $incidentdetails, string $notice)
 Move the infected file to the quarantine folder.
 
static quarantine_file (string $file, string $filename, string $incidentdetails, string $notice)
 Move the infected file to the quarantine folder.
 
static quarantined_file_exists (string $filename)
 Checks whether a file exists inside the antivirus quarantine folder.
 

Public Attributes

const DEFAULT_QUARANTINE_FOLDER = 'antivirus_quarantine'
 Default quarantine folder.
 
const DEFAULT_QUARANTINE_TIME = DAYSECS * 28
 Incident details file.
 
const FILE_HTML_DETAILS = '_details.html'
 Incident details file.
 
const FILE_NAME_DATE_FORMAT = '%Y%m%d%H%M%S'
 Date format in filename.
 
const FILE_ZIP_ALL_INFECTED = '_all_infected_files.zip'
 Zip all infected file.
 
const FILE_ZIP_INFECTED = '_infected_file.zip'
 Zip infected file

 

Detailed Description

Quarantine file.

Author
Nathan Nguyen natha.nosp@m.nngu.nosp@m.yen@c.nosp@m.atal.nosp@m.yst-a.nosp@m.u.ne.nosp@m.t
License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Member Function Documentation

◆ clean_up_quarantine_folder()

static core\antivirus\quarantine::clean_up_quarantine_folder ( int $timetocleanup)
static

Clean up quarantine folder.

Parameters
int$timetocleanuptime to clean up

◆ delete_quarantined_file()

static core\antivirus\quarantine::delete_quarantined_file ( int $fileid)
static

Delete quarantined file.

Parameters
int$fileidid of file to be deleted.

◆ download_all_quarantined_files()

static core\antivirus\quarantine::download_all_quarantined_files ( )
static

Download all quarantined files.

Return values
void

◆ download_quarantined_file()

static core\antivirus\quarantine::download_quarantined_file ( int $fileid)
static

Download quarantined file.

Parameters
int$fileidthe id of file to be downloaded.

◆ get_quarantined_files()

static core\antivirus\quarantine::get_quarantined_files ( )
static

Return array of quarantined files.

Return values
arraylist of quarantined files.

◆ is_quarantine_enabled()

static core\antivirus\quarantine::is_quarantine_enabled ( )
static

Check if the virus quarantine is allowed.

Return values
bool
Exceptions
dml_exception

◆ quarantine_data()

static core\antivirus\quarantine::quarantine_data ( string $data,
string $filename,
string $incidentdetails,
string $notice )
static

Move the infected file to the quarantine folder.

Parameters
string$datadata which is infected.
string$filenameinfected file name.
string$incidentdetailsincident details.
string$noticenotice details.
Return values
string|nullthe name of the newly created quarantined file.
Exceptions
dml_exception

◆ quarantine_file()

static core\antivirus\quarantine::quarantine_file ( string $file,
string $filename,
string $incidentdetails,
string $notice )
static

Move the infected file to the quarantine folder.

Parameters
string$fileinfected file.
string$filenameinfected file name.
string$incidentdetailsincident details.
string$noticenotice details.
Return values
string|nullthe name of the newly created quarantined file.
Exceptions
dml_exception

◆ quarantined_file_exists()

static core\antivirus\quarantine::quarantined_file_exists ( string $filename)
static

Checks whether a file exists inside the antivirus quarantine folder.

Parameters
string$filenamethe filename to check.
Return values
booleanwhether file exists.

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