Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.

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

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

validate($data)   X-Ref
Validate data.

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

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

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.

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

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.

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

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.

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