Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

Differences Between: [Versions 310 and 311] [Versions 310 and 400] [Versions 310 and 401] [Versions 310 and 402] [Versions 310 and 403] [Versions 39 and 310]

Base class for antivirus integration.

Copyright: 2015 Ruslan Kabalin, Lancaster University.
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 241 lines (9 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

scanner:: (8 methods):
  __construct()
  get_config()
  get_scanning_notice()
  set_scanning_notice()
  scan_data()
  message_admins()
  get_incident_details()
  get_messages()


Class: scanner  - X-Ref

Base abstract antivirus scanner class.

__construct()   X-Ref
Class constructor.

return: void.

get_config($property)   X-Ref
Config get method.

param: string $property config property to get.
return: mixed

get_scanning_notice()   X-Ref
Get scanning notice.

return: string

set_scanning_notice($notice)   X-Ref
Set scanning notice.

param: string $notice notice to set.
return: void

scan_data($data)   X-Ref
Scan data.

By default it saves data variable content to file and then scans it using
scan_file method, however if antivirus plugin permits scanning data directly,
the method can be overridden.

param: string $data The variable containing the data to scan.
return: int Scanning result constants.

message_admins($notice, $format = FORMAT_PLAIN, $eventname = 'errors')   X-Ref
This function pushes given messages into the message queue, which will be sent by the antivirus manager.

param: string $notice The body of the email to be sent.
param: string $format The body format.
param: string $eventname event name
return: void

get_incident_details($file = '', $filename = '', $notice = '', $virus = true)   X-Ref
Return incident details

param: string $file full path to the file
param: string $filename original name of the file
param: string $notice notice from antivirus
param: string $virus if this template is due to a virus found.
return: string the incident details

get_messages()   X-Ref
Getter method for messages queued by the antivirus scanner.

return: array