PHPackages                             pato05/amphp-clamav - 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. pato05/amphp-clamav

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

pato05/amphp-clamav
===================

An asynchronous clamd wrapper written with amphp/socket

v2.0.0(2y ago)6179↓50%2MITPHPPHP ^8.0

Since Jan 3Pushed 2y ago1 watchersCompare

[ Source](https://github.com/Pato05/amphp-clamav)[ Packagist](https://packagist.org/packages/pato05/amphp-clamav)[ RSS](/packages/pato05-amphp-clamav/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (6)Versions (4)Used By (0)

amphp-clamav
============

[](#amphp-clamav)

[![license: MIT](https://camo.githubusercontent.com/b8cadaa967891081f8f165695470689986c028821dd8a040132f6e661795dc0d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c7565)](https://camo.githubusercontent.com/b8cadaa967891081f8f165695470689986c028821dd8a040132f6e661795dc0d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c7565)

An asynchronous ClamAV wrapper written with amphp/socket

Migrating from v1.x.x
---------------------

[](#migrating-from-v1xx)

The updated v2.0.0 brought some breaking changes because of the changes in the underlying `amphp/amp`. These underlying changes give a great boost to the asynchronous event loop, being it now based on `Fibers` instead of `Generators`.

Mostly you only need to remove the `yield` keyword before any calls to the library's asynchronous function. Learn more on [Amp's Upgrade Guide](https://amphp.org/upgrade).

Installing
----------

[](#installing)

```
composer require pato05/amphp-clamav

```

Examples
--------

[](#examples)

Ping and scan of a file/directory: [`examples/scan.php`](https://github.com/Pato05/amphp-clamav/blob/main/examples/scan.php)

Scanning from a `ReadableStream` (in this case a `File` instance which implements `ReadableStream`): [`examples/scan_stream.php`](https://github.com/Pato05/amphp-clamav/blob/main/examples/scan_stream.php)

Using a TCP/IP socket instead
-----------------------------

[](#using-a-tcpip-socket-instead)

If you want to use a TCP/IP socket instead of a UNIX one, you should use the `ClamAV\clamav()` function prior to any other call, or just use a custom `ClamAV` instance:

```
\Amp\ClamAV\clamav('tcp://IP:PORT'); // to access it statically
// or
$clamav = new \Amp\ClamAV\ClamAV('tcp://IP:PORT');
```

Be aware that TCP/IP sockets may be slightly slower than UNIX ones.

Using MULTISCAN
---------------

[](#using-multiscan)

MULTISCAN is supported but can only be used on non-session instances (due to a ClamAV limitation).

MULTISCAN allows you to make a multithreaded scan.

```
$result = \Amp\ClamAV\multiScan('FILEPATH');
```

Differences between running a session and without
-------------------------------------------------

[](#differences-between-running-a-session-and-without)

Sessions run on the same socket connection, while non-session instances will reconnect to the socket for each command. The library supports both, it's up to you deciding which to use.

Instantiating a session is pretty straight forward, just use the `ClamAV::session()` method like this:

```
$clamSession = \Amp\ClamAV\session();
```

Though you MUST end every session by using the method `Session::end()`:

```
$clamSession->end();
```

Be aware that in a session you can only execute ONE COMMAND AT A TIME, therefore, if you want to run more than one command in parallel, use the main `ClamAV` class instead.

Multiple `Session`s can also be instantiated.

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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 ~397 days

Total

3

Last Release

795d ago

Major Versions

v1.0.0.9998 → v2.0.02024-03-08

PHP version history (2 changes)v1.0.0.9999PHP ^8.0

v1.0.0.9998PHP \*

### Community

Maintainers

![](https://www.gravatar.com/avatar/ab00459129299e2903db334e221bdf31a9b6c9d1c7e20991aa0f66389cc744fa?d=identicon)[Pato05](/maintainers/Pato05)

---

Top Contributors

[![Pato05](https://avatars.githubusercontent.com/u/20874747?v=4)](https://github.com/Pato05 "Pato05 (9 commits)")

---

Tags

amphpclamavclamav-clientclamav-wrapperphp

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/pato05-amphp-clamav/health.svg)

```
[![Health](https://phpackages.com/badges/pato05-amphp-clamav/health.svg)](https://phpackages.com/packages/pato05-amphp-clamav)
```

###  Alternatives

[danog/madelineproto

Async PHP client API for the telegram MTProto protocol.

3.4k855.0k18](/packages/danog-madelineproto)[amphp/process

A fiber-aware process manager based on Amp and Revolt.

25552.6M52](/packages/amphp-process)[amphp/parallel-functions

Parallel processing made simple.

27910.3M26](/packages/amphp-parallel-functions)[amphp/redis

Efficient asynchronous communication with Redis servers, enabling scalable and responsive data storage and retrieval.

165634.7k44](/packages/amphp-redis)[phpactor/language-server

Generic Language Server Platform

55470.1k6](/packages/phpactor-language-server)[chevere/workflow

Declarative workflow engine for PHP with automatic dependency resolution, sync/async job execution, and type-safe response chaining.

1111.8k1](/packages/chevere-workflow)

PHPackages © 2026

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