2017 © Pedro Peláez
 

library clamav-validator

Custom Laravel 5 anti-virus validator for file uploads.

image

sunspikes/clamav-validator

Custom Laravel 5 anti-virus validator for file uploads.

  • Monday, July 9, 2018
  • by sunspikes
  • Repository
  • 1 Watchers
  • 25 Stars
  • 8,328 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 24 Forks
  • 0 Open issues
  • 9 Versions
  • 19 % Grown

The README.md

ClamAV Virus Validator For Laravel

SensioLabsInsight Code Coverage Code Quality Build Status Latest Stable Version License, (*1)

A custom Laravel virus validator based on ClamAV anti-virus scanner for file uploads., (*2)

, (*3)

Requirements

You must have ClamAV anti-virus scanner running on the server to make this package work., (*4)

You can see the ClamAV installation instructions on the official ClamAV documentation., (*5)

For example on an Ubuntu machine, you can do:, (*6)

# Install clamav virus scanner
sudo apt-get update && sudo apt-get install -y clamav-daemon

# Update virus definitions
sudo freshclam

# Start the scanner service
sudo systemctl enable --now clamav-daemon clamav-freshclam

This package is not tested on Windows, but if you have ClamAV running (usually on port 3310) it should work. You will also need to have sockets extension installed and enabled (all executions without this module will fail with this error - "Use of undefined constant 'AF_INET'")., (*7)

, (*8)

Installation

1. Install the package through Composer.

bash $ composer require sunspikes/clamav-validator, (*9)

2. Add the service provider (for Laravel 5.4 or below)

This package supports Laravel new Package Discovery., (*10)

If you are using Laravel < 5.5, you need to add Sunspikes\ClamavValidator\ClamavValidatorServiceProvider::class to your providers array in config/app.php:, (*11)

'providers' => [
    // ...

    Sunspikes\ClamavValidator\ClamavValidatorServiceProvider::class,
],

3. Publish assets from the vendor package

Config file

The default configuration file does use ENV to override the defaults. If you want to change the configuration file anyway you run the following command to publish the package config file:, (*12)

php artisan vendor:publish --provider="Sunspikes\ClamavValidator\ClamavValidatorServiceProvider" --tag=config

Once the command is finished you should have a config/clamav.php file that will be used as well., (*13)

Language files

If you want to customize the translation or add your own language you can run the following command to publish the language files to a folder you maintain:, (*14)

php artisan vendor:publish --provider="Sunspikes\ClamavValidator\ClamavValidatorServiceProvider" --tag=lang

This will copy the language files to resources/lang/vendor/clamav-validator for Laravel >= 5.1, (*15)

, (*16)

Usage

Use it like any Validator rule:, (*17)

$rules = [
    'file' => 'clamav',
];

ClamavValidator will automatically run multiple files one-by-one through ClamAV in case file represent multiple uploaded files., (*18)

, (*19)

Author

Krishnaprasad MG [@sunspikes] and other awesome contributors, (*20)

The Versions

09/07 2018

dev-master

9999999-dev https://github.com/sunspikes/clamav-validator

Custom Laravel 5 anti-virus validator for file uploads.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel validator clamav virus

09/07 2018

v1.5

1.5.0.0 https://github.com/sunspikes/clamav-validator

Custom Laravel 5 anti-virus validator for file uploads.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel validator clamav virus

25/04 2018

v1.4

1.4.0.0 https://github.com/sunspikes/clamav-validator

Custom Laravel 5 anti-virus validator for file uploads.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel validator clamav virus

31/01 2018

v1.3.1

1.3.1.0 https://github.com/sunspikes/clamav-validator

Custom Laravel 5 anti-virus validator for file uploads.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel validator clamav virus

22/06 2017

v1.3

1.3.0.0 https://github.com/sunspikes/clamav-validator

Custom Laravel 5 anti-virus validator for file uploads.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel validator clamav virus

18/01 2016

v1.2.1

1.2.1.0 https://github.com/sunspikes/clamav-validator

Custom Laravel 5 anti-virus validator for file uploads.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel validator clamav virus

03/12 2015

v1.2

1.2.0.0 https://github.com/sunspikes/clamav-validator

Custom Laravel 5 anti-virus validator for file uploads.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel validator clamav virus

23/11 2015

v1.1

1.1.0.0 https://github.com/sunspikes/clamav-validator

Custom Laravel 5 anti-virus validator for file uploads.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel validator clamav virus

20/10 2015

v1.0

1.0.0.0 https://github.com/sunspikes/clamav-validator

Custom Laravel 5 anti-virus validator for file uploads.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel validator clamav virus