This a fork from our previous php-clamav library. This is the new home for it. PHP library to check files against ClamAV. You can pass a file via UNIX and TCP sockets. If ClamAV is installed locally you can also use clamscan/clamdscan.
You should have ClamAV installed locally or on a secured remote server.
composer install advancedideasmechanics/antivirus-fiesta
$options['clamavScanMOde] = 'cli';
If ClamAV is installed in another location.
$options['clamavCliScanner] = '/usr/local/bin/clamscan;
Instructions coming soon.
$clamav = new Advancedideasmechanics\Antivirus\ClamavService($options);
$response = $clamav->sendToScanner($file);
To see the response from the server you can send to you internal logger or just dump from your test page.
$response['message'] will include the response from ClamAV.
The message if successful will be either "OK" or "VIRUSNAME FOUND"
Options that are available to update are:
$options['clamavScanMode'] = 'local'; Can be 'cli', 'local', 'server' This should match your clamd.conf filesize limit.
$options['clamavMaxFileSize'] = 25000000;
$options['clamavServerHost'] = '127.0.0.1'; Can be clamscan or clamdscan
$options['clamavServerPort'] = 3310;
$options['clamavServerTimeout'] = 30;
$options['clamavServerSocketMode'] = TRUE;
$options['clamavLocalSocket'] = '/var/run/clamav/clamd.ctl';
$options['clamavCliScanner] = '/usr/bin/clamscan';
$options['clamavChunkSize] = 2048; This is used for sockets and not used for the Command Line scanner.