Class implementing ClamAV antivirus.
More...
|
const | SCAN_RESULT_ERROR = 2 |
| Scanning result indicating the error.
|
|
const | SCAN_RESULT_FOUND = 1 |
| Scanning result indicating that virus is found.
|
|
const | SCAN_RESULT_OK = 0 |
| Scanning result indicating no virus found.
|
|
|
stdClass | $config |
| the config for antivirus
|
|
string | $scanningnotice = '' |
| scanning notice
|
|
Class implementing ClamAV antivirus.
- Copyright
- 2015 Ruslan Kabalin, Lancaster University.
-
2019 Didier Raboud, Liip AG.
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
◆ get_config()
core\antivirus\scanner::get_config |
( |
|
$property | ) |
|
|
inherited |
Config get method.
- Parameters
-
string | $property | config property to get. |
- Return values
-
- Exceptions
-
◆ get_scanning_notice()
core\antivirus\scanner::get_scanning_notice |
( |
| ) |
|
|
inherited |
Get scanning notice.
- Return values
-
◆ is_configured()
antivirus_clamav\scanner::is_configured |
( |
| ) |
|
Are the necessary antivirus settings configured?
- Return values
-
bool | True if all necessary config settings been entered |
Reimplemented from core\antivirus\scanner.
◆ message_admins()
core\antivirus\scanner::message_admins |
( |
|
$notice | ) |
|
|
inherited |
Email admins about antivirus scan outcomes.
- Parameters
-
string | $notice | The body of the email to be sent. |
- Return values
-
◆ scan_data()
antivirus_clamav\scanner::scan_data |
( |
|
$data | ) |
|
Scan data.
- Parameters
-
string | $data | The variable containing the data to scan. |
- Return values
-
int | Scanning result constant. |
Reimplemented from core\antivirus\scanner.
◆ scan_data_execute_socket()
antivirus_clamav\scanner::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 | $data | The variable containing the data to scan. |
string | $type | Either 'tcpsocket' or 'unixsocket' |
- Return values
-
int | Scanning result constant. |
◆ scan_data_execute_unixsocket()
antivirus_clamav\scanner::scan_data_execute_unixsocket |
( |
|
$data | ) |
|
◆ scan_file()
antivirus_clamav\scanner::scan_file |
( |
|
$file, |
|
|
|
$filename |
|
) |
| |
Scan file.
This method is normally called from antivirus manager (core::antivirus::manager::scan_file).
- Parameters
-
string | $file | Full path to the file. |
string | $filename | Name of the file (could be different from physical file if temp file is used). |
- Return values
-
int | Scanning result constant. |
Reimplemented from core\antivirus\scanner.
◆ scan_file_execute_commandline()
antivirus_clamav\scanner::scan_file_execute_commandline |
( |
|
$file | ) |
|
Scan file using command line utility.
- Parameters
-
string | $file | Full path to the file. |
- Return values
-
int | Scanning result constant. |
◆ scan_file_execute_socket()
antivirus_clamav\scanner::scan_file_execute_socket |
( |
|
$file, |
|
|
|
$type |
|
) |
| |
Scan file using sockets.
- Parameters
-
string | $file | Full path to the file. |
string | $type | Either 'tcpsocket' or 'unixsocket' |
- Return values
-
int | Scanning result constant. |
◆ scan_file_execute_unixsocket()
antivirus_clamav\scanner::scan_file_execute_unixsocket |
( |
|
$file | ) |
|
◆ set_scanning_notice()
core\antivirus\scanner::set_scanning_notice |
( |
|
$notice | ) |
|
|
protectedinherited |
Set scanning notice.
- Parameters
-
string | $notice | notice to set. |
- Return values
-
The documentation for this class was generated from the following file: