PHPackages                             ylly/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. [Security](/categories/security)
4. /
5. ylly/clamav

ActiveLibrary[Security](/categories/security)

ylly/clamav
===========

A simple PHP library for scanning files with ClamAV

2.0.2(1y ago)25.9kMITPHPPHP ^8.0

Since Mar 25Pushed 1y ago3 watchersCompare

[ Source](https://github.com/ylly/clamav)[ Packagist](https://packagist.org/packages/ylly/clamav)[ RSS](/packages/ylly-clamav/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (3)Versions (8)Used By (0)

Clamav PHP library
==================

[](#clamav-php-library)

[![Build Status](https://camo.githubusercontent.com/7686d65631fb9ae80ae9fd86bcdc11152f2823291156a1664f47933c6d3507c4/68747470733a2f2f7472617669732d63692e6f72672f796c6c792f636c616d61762e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/ylly/clamav)

This library allows you to easily scan file with ClamAv into you project

Require
-------

[](#require)

- PHP 5.6+
- PHP Socket

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

[](#installation)

```
$ composer req ylly/php-clamav-scan

```

Usage
-----

[](#usage)

Create Clamav object :

```
$clamav = ClamavFactory::createFromYamlFile('/some/config/file.yaml');
```

### Clamav Available

[](#clamav-available)

You can check if clamav is available with PING command.

```
$clamav->isAvailable();
```

### Clamav Version

[](#clamav-version)

Get version of clamav

```
$clamav->getVersion();
```

Note : if clamav is unavailable, the function throw an `FailedSocketConnectionException`

### Clamav scan

[](#clamav-scan)

```
// scan path
$result = $clamav->scanPath($path);
```

`$result` is instance of ScanResponse

Status combine with binary or ( | ) :

1. `Clamav::CLAMAV_INFECT`
2. `Clamav::CLAMAV_ERROR`
3. `Clamav::CLAMAV_CLEAN`

Use helper for check status

- `isInfected()`
- `isUnckeck()`
- `isClean()`
- `hasSomeProblems()`

Note : if clamav is unavailable, the function throw an `FailedSocketConnectionException`

Configuration file
------------------

[](#configuration-file)

```
address: '/var/run/clamav/clamd.sock' # Unix socket or IPv4 / IPv6
port: 3310 # optional for IP
socket_length: 200000 # optionnal
```

###  Health Score

39

—

LowBetter than 85% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 70% 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 ~497 days

Total

5

Last Release

657d ago

Major Versions

1.1.x-dev → 2.0.02023-11-13

PHP version history (3 changes)1.0.0PHP ^5.6 || ^7.0

2.0.0PHP 8.0.\*

2.0.1PHP ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/73162a7f8bb82c57c453c11671608f59e3c87bf7f76724826b369d01a25e87a8?d=identicon)[ylly](/maintainers/ylly)

---

Top Contributors

[![samuel-queniart](https://avatars.githubusercontent.com/u/2217055?v=4)](https://github.com/samuel-queniart "samuel-queniart (7 commits)")[![shynixxx](https://avatars.githubusercontent.com/u/33019897?v=4)](https://github.com/shynixxx "shynixxx (2 commits)")[![corentinHuibant](https://avatars.githubusercontent.com/u/43136879?v=4)](https://github.com/corentinHuibant "corentinHuibant (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M2.9k](/packages/craftcms-cms)[tempest/framework

The PHP framework that gets out of your way.

2.2k31.1k12](/packages/tempest-framework)[rcsofttech/audit-trail-bundle

Enterprise-grade, high-performance Symfony audit trail bundle. Automatically track Doctrine entity changes with split-phase architecture, multiple transports (HTTP, Queue, Doctrine), and sensitive data masking.

1155.2k](/packages/rcsofttech-audit-trail-bundle)[friendsoftypo3/content-blocks

TYPO3 CMS Content Blocks - Content Types API | Define reusable components via YAML

101466.4k45](/packages/friendsoftypo3-content-blocks)[2lenet/crudit-bundle

The easy like Crud'it Bundle.

1715.6k12](/packages/2lenet-crudit-bundle)

PHPackages © 2026

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