Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jdecool/clamav-php-client
PHP client for ClamAV deamon
https://github.com/jdecool/clamav-php-client
clamav php php-library
Last synced: 2 months ago
JSON representation
PHP client for ClamAV deamon
- Host: GitHub
- URL: https://github.com/jdecool/clamav-php-client
- Owner: jdecool
- License: mit
- Created: 2018-09-02T09:51:50.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-09-02T13:49:40.000Z (over 6 years ago)
- Last Synced: 2024-04-21T07:42:07.102Z (9 months ago)
- Topics: clamav, php, php-library
- Language: PHP
- Size: 10.7 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
ClamAV deamon PHP client
========================This library is a PHP client for [ClamAV](https://www.clamav.net) deamon.
## Installation
It can be install through Composer.
```bash
$ composer require jdecool/clamav-client
```## Usage
```php
$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
```php
$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`