Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.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.