kipchak / driver-clamav
A ClamAV (clamd) antivirus driver (dependency) for the Kipchak API Development Kit (ADK)
Package info
github.com/kipchak-dev/driver-clamav
Type:middleware
pkg:composer/kipchak/driver-clamav
Requires
- kipchak/core: ^2 || ^3
- kipchak/driver-config: ^1
Requires (Dev)
- phpunit/phpunit: ^12
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-11-03 09:27:51 UTC
README
A ClamAV (clamd) antivirus driver for the Kipchak API Development Kit.
Speaks the clamd INSTREAM protocol over TCP to scan in-memory byte blobs
without writing them to disk.
Config
config/kipchak.clamav.php — one entry per named connection:
return [ 'default' => [ 'host' => env('CLAMAV_HOST', '127.0.0.1'), 'port' => (int) env('CLAMAV_PORT', '3310'), 'timeout' => (float) env('CLAMAV_TIMEOUT_SECONDS', '30'), ], ];
Boot
use Kipchak\Driver\ClamAV\ClamAV; ClamAV::initialise($container);
Usage
$result = ClamAV::get('default')->scan($bytes); if (! $result->isClean()) { // $result->getSignature() e.g. "Eicar-Test-Signature" }
scan() throws Kipchak\Driver\ClamAV\Exception\ConnectionException when
clamd cannot be reached — the caller decides whether that fails open or closed.
Tests
composer install vendor/bin/phpunit
The tests override the socket exchange with canned clamd responses, so no
running daemon is required. Live coverage uses the EICAR test signature.