A PHP client library for ClamAV clamd daemon

v2.1.0 2017-02-22 13:54 UTC

This package is auto-updated.

Last update: 2020-10-24 12:41:55 UTC


Build Status

Quahog is a simple PHP library to interface with the clamd anti-virus daemon. It was written as all of the libraries out there for interfacing with ClamAV from PHP use exec('clamscan'), which isn't exactly an ideal solution, as clamscan loads the entire database into memory each time it is run - this doesn't, so it scans a lot (lot!) faster.


It is recommended to install Quahog through composer.

    "require": {
        "xenolope/quahog": "2.*"


// Create a new socket instance
$socket = (new \Socket\Raw\Factory())->createClient('unix:///var/run/clamav/clamd.ctl');

// Create a new instance of the Client
$quahog = new \Xenolope\Quahog\Client($socket);

// Scan a file
$result = $quahog->scanFile('/tmp/virusfile');

// Scan a file or directory recursively
$result = $quahog->contScan('/tmp/virusdirectory');

// Scan a file or directory recursively using multiple threads
$result = $quahog->multiscanFile('/tmp/virusdirectory');

// Scan a stream, and optionally pass the maximum chunk size in bytes
$result = $quahog->scanStream(file_get_contents('/tmp/virusfile'), 1024);

// Scan multiple files in a row
$result = $quahog->scanFile('/tmp/virusfile');
$result2 = $quahog->scanFile('/tmp/virusfile2');

// Ping clamd
$result = $quahog->ping();

// Get ClamAV version details
$result = $quahog->version();

// View statistics about the ClamAV scan queue
$result = $quahog->stats();

// Reload the virus database

// Shutdown clamd cleanly


To run the test suite you will need PHPUnit installed. Go to the project root and run:

$ phpunit


Quahog is released under the MIT License