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 2w 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 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity56

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

2783d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3531327?v=4)[Frederik Schubert](/maintainers/ferdynator)[@ferdynator](https://github.com/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

[api-platform/core

Build a fully-featured hypermedia or GraphQL API in minutes!

2.6k50.1M314](/packages/api-platform-core)[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.5M378](/packages/easycorp-easyadmin-bundle)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.4M196](/packages/sulu-sulu)[sunspikes/clamav-validator

Custom Laravel anti-virus validator for file uploads using ClamAV.

3712.0M5](/packages/sunspikes-clamav-validator)[web-auth/webauthn-framework

FIDO2/Webauthn library for PHP and Symfony Bundle.

51390.8k3](/packages/web-auth-webauthn-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.

1175.2k](/packages/rcsofttech-audit-trail-bundle)

PHPackages © 2026

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