PHPackages                             xenolope/quahog - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. xenolope/quahog

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

xenolope/quahog
===============

A PHP client library for ClamAV clamd daemon

v3.0.0(5y ago)867.4M—1.2%24[2 PRs](https://github.com/jonjomckay/quahog/pulls)19MITPHPPHP &gt;=7.3CI failing

Since Dec 2Pushed 1y ago8 watchersCompare

[ Source](https://github.com/jonjomckay/quahog)[ Packagist](https://packagist.org/packages/xenolope/quahog)[ RSS](/packages/xenolope-quahog/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (3)Versions (13)Used By (19)

Quahog
======

[](#quahog)

[![Build Status](https://github.com/jonjomckay/quahog/workflows/Quahog%20Tests/badge.svg)](https://github.com/jonjomckay/quahog/actions)

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.

Installation
------------

[](#installation)

It is recommended to install Quahog through [composer](http://getcomposer.org).

```
{
    "require": {
        "xenolope/quahog": "3.*"
    }
}
```

Usage
-----

[](#usage)

```
// Create a new socket instance
$socket = (new \Socket\Raw\Factory())->createClient('unix:///var/run/clamav/clamd.ctl'); # Using a UNIX socket
$socket = (new \Socket\Raw\Factory())->createClient('tcp://192.168.1.1:3310'); # Using a TCP socket

// 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
$quahog->startSession();
$result = $quahog->scanFile('/tmp/virusfile');
$result2 = $quahog->scanFile('/tmp/virusfile2');
$quahog->endSession();

// 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
$quahog->reload();

// Shutdown clamd cleanly
$quahog->shutdown();
```

### Working with the result

[](#working-with-the-result)

```
// Result is an instance of \Xenolope\Quahog\Result.
$result = $quahog->scanFile('/tmp/virusfile');

// A result id of a session that was used.
$result->getId();

// The file name of the scanned file.
$result->getFilename();

// The reason why a scan resulted in a failure. Returns null if the scan was successful.
$result->getReason();

// A boolean value that is true, in case the scan was successful.
$result->isOk();

// A boolean value that is true, in case the scan failed. This is the opposite of isOk().
$result->hasFailed();

// A boolean value that is true, if a virus was found.
$result->isFound();

// A boolean value that is true, if an error happened.
$result->isError();
```

Testing
-------

[](#testing)

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

```
$ phpunit
```

License
-------

[](#license)

Quahog is released under the [MIT License](http://www.opensource.org/licenses/MIT)

###  Health Score

51

—

FairBetter than 96% of packages

Maintenance33

Infrequent updates — may be unmaintained

Popularity61

Solid adoption and visibility

Community35

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~283 days

Recently: every ~621 days

Total

10

Last Release

2001d ago

Major Versions

v1.4 → v2.0.02016-12-07

v2.1.1 → v3.0.02020-11-25

PHP version history (3 changes)v1.0PHP &gt;=5.3

v2.0.0PHP &gt;=5.6

v3.0.0PHP &gt;=7.3

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/456645?v=4)[Jonjo McKay](/maintainers/jonjomckay)[@jonjomckay](https://github.com/jonjomckay)

---

Top Contributors

[![davidvanlaatum](https://avatars.githubusercontent.com/u/1491158?v=4)](https://github.com/davidvanlaatum "davidvanlaatum (49 commits)")[![jonjomckay](https://avatars.githubusercontent.com/u/456645?v=4)](https://github.com/jonjomckay "jonjomckay (39 commits)")[![jonjo-blur](https://avatars.githubusercontent.com/u/5681507?v=4)](https://github.com/jonjo-blur "jonjo-blur (33 commits)")[![SenseException](https://avatars.githubusercontent.com/u/859964?v=4)](https://github.com/SenseException "SenseException (18 commits)")[![MassiveHiggsField](https://avatars.githubusercontent.com/u/3681429?v=4)](https://github.com/MassiveHiggsField "MassiveHiggsField (10 commits)")[![jchamberlain](https://avatars.githubusercontent.com/u/3923548?v=4)](https://github.com/jchamberlain "jchamberlain (2 commits)")[![TheOnlyMerlin](https://avatars.githubusercontent.com/u/3262309?v=4)](https://github.com/TheOnlyMerlin "TheOnlyMerlin (1 commits)")[![derikb](https://avatars.githubusercontent.com/u/301218?v=4)](https://github.com/derikb "derikb (1 commits)")[![gimler](https://avatars.githubusercontent.com/u/200904?v=4)](https://github.com/gimler "gimler (1 commits)")[![lbialy](https://avatars.githubusercontent.com/u/8607442?v=4)](https://github.com/lbialy "lbialy (1 commits)")[![SharkMachine](https://avatars.githubusercontent.com/u/7488694?v=4)](https://github.com/SharkMachine "SharkMachine (1 commits)")[![bkuhl](https://avatars.githubusercontent.com/u/524933?v=4)](https://github.com/bkuhl "bkuhl (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/xenolope-quahog/health.svg)

```
[![Health](https://phpackages.com/badges/xenolope-quahog/health.svg)](https://phpackages.com/packages/xenolope-quahog)
```

###  Alternatives

[graze/telnet-client

Telnet client written in PHP

50233.9k4](/packages/graze-telnet-client)[zoon/rialto

Manage Node resources from PHP

12199.4k3](/packages/zoon-rialto)[fbett/le_acme2

Letsencrypt PHP ACME v2 client

323.7k](/packages/fbett-le-acme2)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
