Download the PHP package sunspikes/clamav-validator without Composer

On this page you can find all versions of the php package sunspikes/clamav-validator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package clamav-validator

ClamAV Virus Validator For Laravel

Code Coverage Code Quality Latest Stable Version License

A custom Laravel virus validator based on ClamAV anti-virus scanner for file uploads.

Requirements

You can see the ClamAV installation instructions on the official ClamAV documentation.

For example on an Ubuntu machine, you can do:

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'").

Installation

1. Install the package through Composer.

2. 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:

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.

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:

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

This will copy the language files to lang/vendor/clamav-validator.

Configuration

The package can be configured using environment variables:

Environment Variable Default Description
CLAMAV_PREFERRED_SOCKET unix_socket Socket type: unix_socket or tcp_socket
CLAMAV_UNIX_SOCKET /var/run/clamav/clamd.ctl Path to the ClamAV unix socket
CLAMAV_TCP_SOCKET tcp://127.0.0.1:3310 TCP socket connection string
CLAMAV_SOCKET_CONNECT_TIMEOUT null Connection timeout in seconds (null = no limit)
CLAMAV_SOCKET_READ_TIMEOUT 30 Read timeout in seconds
CLAMAV_CLIENT_EXCEPTIONS false Throw exceptions on scan failures instead of returning validation failure
CLAMAV_SKIP_VALIDATION false Skip virus scanning entirely (useful for local development)

Usage

Use it like any Validator rule:

Or in a Form Request:

ClamavValidator will automatically run multiple files one-by-one through ClamAV in case file represents multiple uploaded files.

Author

Krishnaprasad MG [@sunspikes] and other awesome contributors


All versions of clamav-validator with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
ext-sockets Version *
xenolope/quahog Version ^3.0
illuminate/support Version ^9.0 || ^10.0 || ^11.0 || ^12.0 || ^13.0
illuminate/validation Version ^9.0 || ^10.0 || ^11.0 || ^12.0 || ^13.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package sunspikes/clamav-validator contains the following files

Loading the files please wait ...