Download the PHP package ferdynator/clamav-constraint without Composer
On this page you can find all versions of the php package ferdynator/clamav-constraint. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ferdynator/clamav-constraint
More information about ferdynator/clamav-constraint
Files in ferdynator/clamav-constraint
Package clamav-constraint
Short Description This repository provides a virus scan validator constraint for Symfony-based projects.
License MIT
Homepage https://github.com/ferdynator/clamav-constraint
Informations about the package clamav-constraint
ClamAv-Constraint
This is a custom Symfony anti-virus validator for file uploads. It uses the 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 and the TissueBundle.
Installation
composer require ferdynator/clamav-constraint
Also make sure you have ClamAv
installed.
Usage
Add this constraint in your entity of choice:
use ferdynator\ClamAvConstraint\Validator\Constraints as VirusAssert;
class JobImage {
...
/*
* ...
* @VirusAssert\ClamAv
*/
protected $file;
...
}
Configuration
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
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;
All versions of clamav-constraint with dependencies
symfony/http-foundation Version *
symfony/validator Version *
xenolope/quahog Version ^2.1