jdecool/clamav-client

ClamAV PHP deamon client

1.0.0 2018-09-02 13:41 UTC

This package is auto-updated.

Last update: 2020-08-08 00:10:24 UTC


README

This library is a PHP client for ClamAV deamon.

Installation

It can be install through Composer.

$ composer require jdecool/clamav-client

Usage

$clientFactory = new JDecool\ClamAV\ClientFactory();

$client = $clientFactory->create('127.0.0.1', 3310);
$client->ping(); // throw an ConnectionError exception if error occured

Scan a file

$clientFactory = new JDecool\ClamAV\ClientFactory();

$client = $clientFactory->create('127.0.0.1', 3310);
$analysis = $client->scan('/path/to/file');

$analysis->count(); // = 1
$analysis->isInfected(); // true or false
$analysis->getMessage(); // if file is infected, it contains malware name

Available méthods

  • JDecool\ClamAV\Client::ping(): void
  • JDecool\ClamAV\Client::version(): string
  • JDecool\ClamAV\Client::reload(): void
  • JDecool\ClamAV\Client::shutdown(): void
  • JDecool\ClamAV\Client::scanBatch(array $paths): JDecool\ClamAV\Analysis\Analysis
  • JDecool\ClamAV\Client::scan(string ...$paths): JDecool\ClamAV\Analysis\Analysis
  • JDecool\ClamAV\Client::contScan(string $path): JDecool\ClamAV\Analysis\Analysis
  • JDecool\ClamAV\Client::multiscan(string $path): JDecool\ClamAV\Analysis\Analysis
  • JDecool\ClamAV\Client::allMatchScan(string $path): JDecool\ClamAV\Analysis\Analysis
  • JDecool\ClamAV\Client::stats(string $path): string
  • JDecool\ClamAV\Client::startSession(): void
  • JDecool\ClamAV\Client::endSession(): void