GithubHelp home page GithubHelp logo

matthewpallotta / php-clamav Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 1.0 32 KB

A PHP client library form ClamAV that can use the cli, unix and tcp sockets.

License: MIT License

PHP 100.00%
clamav-client php7 php-library packagist php-framework antivirus clamav

php-clamav's Introduction

php-clamav

PHP library to check files against ClamAV. You can pass a file via UNIX and TCP sockets. If ClamAV is installed locally you can also use clamscan/clamdscan.

Install

You should have ClamAV installed locally or on a secured remote server.

Composer

composer install matthewpallotta/clamavphp

Stand-Alone

require('./vendor/autoload.php');

$options['clamavScanMOde] = 'cli';

If ClamAV is installed in another location.

$options['clamavCliScanner] = '/usr/local/bin/clamscan;

Zend Framework 3

Instructions coming soon.

Call package

$clamav = new Matthewpallotta\Clamavphp\ClamavService($options);

$response = $clamav->sendToScanner($file);

To see the response from the server you can send to you internal logger or just dump from your test page.

var_dump($response);

Information

In $response['message'] will include the response from ClamAV.

The message if successful will be either "OK" or "VIRUSNAME FOUND"

Options that are available to update are:

$options['clamavScanMode'] = 'local'; Can be 'cli', 'local', 'server'

$options['clamavMaxFileSize'] = 25000000; This should match your clamd.conf filesize limit.

$options['clamavServerHost'] = '127.0.0.1';

$options['clamavServerPort'] = 3310;

$options['clamavServerTimeout'] = 30;

$options['clamavServerSocketMode'] = TRUE;

$options['clamavLocalSocket'] = '/var/run/clamav/clamd.ctl';

$options['clamavCliScanner] = '/usr/bin/clamscan'; Can be clamscan or clamdscan

$options['clamavChunkSize] = 2048; This is used for sockets and not used for the Command Line scanner.

php-clamav's People

Contributors

matthewpallotta avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.