PHPackages                             ferdynator/clamav-constraint - 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. [Validation &amp; Sanitization](/categories/validation)
4. /
5. ferdynator/clamav-constraint

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

ferdynator/clamav-constraint
============================

This repository provides a virus scan validator constraint for Symfony-based projects.

1.0.0(7y ago)16.5kMITPHPPHP &gt;=7.2

Since Nov 16Pushed 7y ago1 watchersCompare

[ Source](https://github.com/ferdynator/clamav-constraint)[ Packagist](https://packagist.org/packages/ferdynator/clamav-constraint)[ Docs](https://github.com/ferdynator/clamav-constraint)[ RSS](/packages/ferdynator-clamav-constraint/feed)WikiDiscussions master Synced 1mo ago

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

ClamAv-Constraint
=================

[](#clamav-constraint)

[![MIT Licence](https://camo.githubusercontent.com/57a78e9d793bcdcd334210014933764596fd7d9d8cc032452d6859527053280d/68747470733a2f2f6261646765732e66726170736f66742e636f6d2f6f732f6d69742f6d69742e706e673f763d313033)](https://opensource.org/licenses/mit-license.php)

This is a custom Symfony anti-virus validator for file uploads. It uses the [Quahog](https://github.com/jonjomckay/quahog) library to connect to a running clamav unix socket and scan the uploaded file.

This repository is strongly influenced by the [clamav-validator for laravel](https://github.com/sunspikes/clamav-validator)and the [TissueBundle](https://github.com/Evozon-PHP/TissueBundle).

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

[](#installation)

```
composer require ferdynator/clamav-constraint

```

Also make sure you have [`ClamAv`](http://www.clamav.net/documents/installing-clamav) installed.

Usage
-----

[](#usage)

Add this constraint in your entity of choice:

```
use ferdynator\ClamAvConstraint\Validator\Constraints as VirusAssert;

class JobImage {

    ...

    /*
     * ...
     * @VirusAssert\ClamAv
     */
    protected $file;

    ...
}

```

### Configuration

[](#configuration)

#### Alternative socket

[](#alternative-socket)

In case you are not using a unix socket or have it in a non-standard position you can pass an alternative socket-url:

```
/*
 * ...
 * @VirusAssert\ClamAv(
 *     socket="tcp://0.0.0.0:1234"
 * )
 */
protected $file;

```

#### File permissions

[](#file-permissions)

The `clamav` daemon needs read-access to the uploaded file. You can specify a chmod-mode with the `chmod` option of the constraint.

```
/*
 * ...
 * @VirusAssert\ClamAv(
 *     chmod=0600
 * )
 */
protected $file;

```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

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

Unknown

Total

1

Last Release

2731d ago

### Community

Maintainers

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

---

Tags

symfonybundlevirusclamavfileuploadquahog

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[sunspikes/clamav-validator

Custom Laravel 5 anti-virus validator for file uploads.

3651.8M3](/packages/sunspikes-clamav-validator)[rollerworks/password-strength-bundle

Password-strength validator bundle for Symfony

1433.7M6](/packages/rollerworks-password-strength-bundle)[isometriks/spam-bundle

Provides spam protection for Symfony forms

46200.6k1](/packages/isometriks-spam-bundle)[fresh/centrifugo-bundle

Provides communication with web-socket server Centrifugo in Symfony applications.

83375.3k](/packages/fresh-centrifugo-bundle)[j-ben87/parsley-bundle

Convert Symfony constraints into data-attributes for client-side validation with Parsley.

1432.7k](/packages/j-ben87-parsley-bundle)[sfmok/request-input-bundle

Converts request data into DTO inputs objects with validation.

3512.8k](/packages/sfmok-request-input-bundle)

PHPackages © 2026

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