jdecool / clamav-client
ClamAV PHP deamon client
Installs: 1 240
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 1
Open Issues: 0
Requires
- php: >=7.1
- clue/socket-raw: ^1.3
- psr/log: ^1.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.12
- phpstan/phpstan: ^0.10.2
- phpunit/phpunit: ^7.3
This package is auto-updated.
Last update: 2024-12-08 09:45:55 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