kipchak/driver-clamav

A ClamAV (clamd) antivirus driver (dependency) for the Kipchak API Development Kit (ADK)

Maintainers

Package info

1x.ax/mamluk/kipchak/drivers/clamav.git

Homepage

Type:middleware

pkg:composer/kipchak/driver-clamav

Transparency log

Statistics

Installs: 12

Dependents: 0

Suggesters: 0

1.0 2026-08-05 10:11 UTC

This package is not auto-updated.

Last update: 2026-08-06 08:49:01 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.