Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
antivirus_clamav

Namespaces

namespace  antivirus_clamav
  
 
namespace  antivirus_clamav\privacy
  
 

Classes

class  antivirus_clamav\privacy\provider
 Privacy Subsystem for antivirus_clamav implementing null_provider. More...
 
class  antivirus_clamav\scanner
 Class implementing ClamAV antivirus. More...
 
class  antivirus_clamav_pathtounixsocket_setting
 Admin setting for unix socket path, adds verification. More...
 
class  antivirus_clamav_runningmethod_setting
 Admin setting for running, adds verification. More...
 
class  antivirus_clamav_socket_setting
 Abstract socket checking class. More...
 
class  antivirus_clamav_tcpsockethost_setting
 Admin setting for Internet domain socket host, adds verification. More...
 

Functions

 antivirus_clamav::scan_data_execute_socket ($data, $type)
 Scan data socket.
 
 antivirus_clamav::scan_data_execute_unixsocket ($data)
 Scan data using Unix domain socket.
 
 antivirus_clamav::scan_file_execute_unixsocket ($file)
 Scan file using Unix domain socket.
 
 xmldb_antivirus_clamav_upgrade ($oldversion)
 Run all ClamAV plugin upgrade steps between the current DB version and the current version on disk.
 

Variables

 $plugin = 2024041600
 
const antivirus_clamav::ANTIVIRUS_CLAMAV_SOCKET_CHUNKSIZE 33554432
 Default socket data stream chunk size (32Mb: 32 * 1024 * 1024)
 
const antivirus_clamav::ANTIVIRUS_CLAMAV_SOCKET_TIMEOUT 10
 Default socket timeout.
 
$plugin component = 'antivirus_clamav'
 
$plugin version = 2024042200
 

Detailed Description

Function Documentation

◆ scan_data_execute_socket()

antivirus_clamav\scan_data_execute_socket ( $data,
$type )

Scan data socket.

We are running INSTREAM command and passing data stream in chunks. The format of the chunk is: <length><data> where <length> is the size of the following data in bytes expressed as a 4 byte unsigned integer in network byte order and <data> is the actual chunk. Streaming is terminated by sending a zero-length chunk. Do not exceed StreamMaxLength as defined in clamd.conf, otherwise clamd will reply with INSTREAM size limit exceeded and close the connection.

Parameters
string$dataThe variable containing the data to scan.
string$typeEither 'tcpsocket' or 'unixsocket'
Return values
intScanning result constant.

◆ scan_data_execute_unixsocket()

antivirus_clamav\scan_data_execute_unixsocket ( $data)

Scan data using Unix domain socket.

Deprecated
since Moodle 3.9 MDL-64075 - please do not use this function any more.
See also
antivirus_clamav\scanner\scan_data_execute_socket()
Parameters
string$dataThe variable containing the data to scan.
Return values
intScanning result constant.

◆ scan_file_execute_unixsocket()

antivirus_clamav\scan_file_execute_unixsocket ( $file)

Scan file using Unix domain socket.

Deprecated
since Moodle 3.9 MDL-64075 - please do not use this function any more.
See also
antivirus_clamav\scanner\scan_file_execute_socket()
Parameters
string$fileFull path to the file.
Return values
intScanning result constant.

◆ xmldb_antivirus_clamav_upgrade()

xmldb_antivirus_clamav_upgrade ( $oldversion)

Run all ClamAV plugin upgrade steps between the current DB version and the current version on disk.

Parameters
int$oldversionThe old version of atto in the DB.
Return values
bool