sineflow/clamav
最新稳定版本:v1.1.3
Composer 安装命令:
composer require sineflow/clamav
包简介
ClamAV PHP Client for Symfony
README 文档
README
This library is a PHP client for working with a ClamAV daemon. It also provides optional Symfony integration.
Requirements:
You need to have ClamAV installed and configured to accept socket and/or network connections: https://docs.clamav.net/manual/Installing.html
Installation
$ composer require sineflow/clamav
Usage as a standalone library
$scanner = new Scanner(new ScanStrategyClamdUnix($socket));
$scanner = new Scanner(new ScanStrategyClamdNetwork($host, $port));
Usage as a Symfony bundle
Enable the bundle
// config/bundles.php return [ // ... Sineflow\ClamAV\Bundle\SineflowClamAVBundle::class => ['all' => true], ];
Configuration:
sineflow_clam_av:
strategy: clamd_unix
socket: "/var/run/clamav/clamd.ctl"
or
sineflow_clam_av:
strategy: clamd_network
host: 127.0.0.1
port: 3310
Scanning files
use Sineflow\ClamAV\Scanner;
use Sineflow\ClamAV\Exception\FileScanException;
use Sineflow\ClamAV\Exception\SocketException;
public function myAction(Scanner $scanner)
{
try {
$scannedFile = $scanner->scan($file);
if (!$scannedFile->isClean()) {
echo $scannedFile->getVirusName();
}
} catch (SocketException $e) {
...
} catch (FileScanException $e) {
...
}
}
统计信息
- 总下载量: 136.43k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 8
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 1
其他信息
- 授权协议: MIT
- 更新时间: 2020-09-29