Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

ClamAV antivirus adminlib.

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

Defines 4 classes

antivirus_clamav_runningmethod_setting:: (2 methods):
  write_setting()
  validate()

antivirus_clamav_socket_setting:: (1 method):
  validate_clamav_socket()

antivirus_clamav_pathtounixsocket_setting:: (1 method):
  validate()

antivirus_clamav_tcpsockethost_setting:: (1 method):
  validate()


Class: antivirus_clamav_runningmethod_setting  - X-Ref

Admin setting for running, adds verification.

write_setting($data)   X-Ref
Save a setting

param: string $data
return: string empty or error string

validate($data)   X-Ref
Validate data.

This ensures that the selected socket transport is supported by this system.

param: string $data
return: mixed True on success, else error message.

Class: antivirus_clamav_socket_setting  - X-Ref

Abstract socket checking class

validate_clamav_socket($socketaddress)   X-Ref
Ping ClamAV socket.

This ensures that a socket setting is correct and that ClamAV is running.

param: string $socketaddress Address to the socket to connect to (for stream_socket_client)
return: mixed True on success, else error message.

Class: antivirus_clamav_pathtounixsocket_setting  - X-Ref

Admin setting for unix socket path, adds verification.

validate($data)   X-Ref
Validate data.

This ensures that unix socket setting is correct and ClamAV is running.

param: string $data
return: mixed True on success, else error message.

Class: antivirus_clamav_tcpsockethost_setting  - X-Ref

Admin setting for Internet domain socket host, adds verification.

validate($data)   X-Ref
Validate data.

This ensures that Internet domain socket setting is correct and ClamAV is running.

param: string $data
return: mixed True on success, else error message.