Package Data | |
---|---|
Maintainer Username: | sunspikes |
Maintainer Contact: | sunspikes@gmail.com (Krishnaprasad MG) |
Package Create Date: | 2014-12-04 |
Package Last Update: | 2024-10-01 |
Home Page: | |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-11-18 03:02:15 |
Package Statistics | |
---|---|
Total Downloads: | 1,072,498 |
Monthly Downloads: | 33,414 |
Daily Downloads: | 260 |
Total Stars: | 315 |
Total Watchers: | 10 |
Total Forks: | 68 |
Total Open Issues: | 10 |
Custom Laravel 5 anti-virus validator for file uploads.
You must have ClamAV anti-virus scanner running on the server to make this package work.
You can see the ClamAV installation instructions on the official ClamAV documentation.
For example on an Ubuntu machine, you can do:
# Install clamav virus scanner
sudo apt-get update
sudo apt-get install clamav-daemon
# Update virus definitions
sudo freshclam
# Start the scanner service
sudo service clamav-daemon start
This package is not tested on windows, but if you have ClamAV running (usually on port 3310) it should work.
$ composer require sunspikes/clamav-validator
This package supports Laravel new Package Discovery.
If you are using Laravel < 5.5, you need to add Sunspikes\ClamavValidator\ClamavValidatorServiceProvider::class
to your providers
array in config/app.php
:
'providers' => array(
// ...
Sunspikes\ClamavValidator\ClamavValidatorServiceProvider::class,
),
Use it like any Validator
rule:
$rules = array(
'my_file_field' => 'clamav',
);
By default the package will try to connect the clamav daemon via the default socket file (/var/run/clamav/clamd.ctl) and if it fails it will try the tcp port (127.0.0.1:3310)
But you can set the CLAMAV_UNIX_SOCKET
(socket file path) or CLAMAV_LOCAL_TCP_SOCKET
(host:port) environment variables to override this.
Krishnaprasad MG [@sunspikes]
Contact me at [sunspikes at gmail dot com]