定制 ferdynator/clamav-constraint 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ferdynator/clamav-constraint

Composer 安装命令:

composer require ferdynator/clamav-constraint

包简介

This repository provides a virus scan validator constraint for Symfony-based projects.

README 文档

README

MIT Licence

This is a custom Symfony anti-virus validator for file uploads. It uses the Quahog library to connect to a running clamav unix socket and scan the uploaded file.

This repository is strongly influenced by the clamav-validator for laravel and the TissueBundle.

Installation

composer require ferdynator/clamav-constraint

Also make sure you have ClamAv installed.

Usage

Add this constraint in your entity of choice:

use ferdynator\ClamAvConstraint\Validator\Constraints as VirusAssert;

class JobImage {
    
    ...
    
    /*
     * ...
     * @VirusAssert\ClamAv
     */
    protected $file;

    ...
}

Configuration

Alternative socket

In case you are not using a unix socket or have it in a non-standard position you can pass an alternative socket-url:

/*
 * ...
 * @VirusAssert\ClamAv(
 *     socket="tcp://0.0.0.0:1234"
 * )
 */
protected $file;

File permissions

The clamav daemon needs read-access to the uploaded file. You can specify a chmod-mode with the chmod option of the constraint.

/*
 * ...
 * @VirusAssert\ClamAv(
 *     chmod=0600
 * )
 */
protected $file;

统计信息

  • 总下载量: 6.52k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-11-16

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固