MMOframework
Why AI Playground Libraries Developers Agency
FR EN
Build a project live
Index

ClamdScanner

MMO\edms\scanners · 1 symbol · generated 30 Nov 2026

class

ClamdScanner

ClamdScanner.php:19

The files analysed by a clamd daemon (ClamAV), through its socket: the bytes are sent to it (INSTREAM), so it needs no access to the application's files, and php no extension.

class MMO\edms\scanners\ClamdScanner implements MMO\edms\interfaces\iScanner
Namespace
MMO\edms\scanners
Implements
iScanner
clamd refuses a stream bigger than its `StreamMaxLength` (25 MB by default): set it to edms' `maxSize` at least, or the bigger files cannot be analysed ([`eScanUnavailable`](https://mmoframework.fr/en/documentation/mmo.edms/php/exceptions/eScanUnavailable.md#escanunavailable)).
"MMO\\edms\\FileManager": { "scanner": {"$": "MMO\\edms\\scanners\\ClamdScanner", "socket": "unix:///run/clamav/clamd.ctl"} }

Index

chunkSize
socket
timeout
ask($command, $stream)Send $command (z commands: their answer ends with a NUL), then the bytes of $stream, if any, in chunks
ping()
scan($filename)
__construct($socket)

Properties3

chunkSize

int $chunkSize = 65536
Type
int

socket

string $socket = 'unix:///run/clamav/clamd.ctl'
Type
string

timeout

float $timeout = 60.0
Type
float

Methods4

ask($command, $stream)

ClamdScanner.php:57

Send $command (z commands: their answer ends with a NUL), then the bytes of $stream, if any, in chunks

protected function ask(string $command, $stream = null): string
$commandstring
$stream = null
returnsstringclamd's answer
throwsif clamd cannot be reached, or does not answer