cakedc/cakephp-clamav plugin for CakePHP

Installs: 8 549

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 7

Forks: 1

Open Issues: 0


3.0.0-RC1 2023-12-11 13:16 UTC

This package is auto-updated.

Last update: 2024-07-11 14:41:28 UTC


Build Status Coverage Status Downloads Latest Version License

ClamAV integration with CakePHP via Validator


  • CakePHP 3.8.0+
  • PHP 7.2+
  • Clamd (daemon) up and running, connection via socket


composer require cakedc/cakephp-clamav

  • Ensure clamav is up and running as daemon
  • Configure the plugin using
\Cake\Core\Configure::write('CakeDC/Clamav', [
    // WARNING, disabling will SKIP virus check in validation rules
    'enabled' => true,
    // clamd listening in this socket, defaults to unix file socket
    'socketConfig' => [
        'host' => 'unix:///var/run/clamav/clamd.ctl',
        'port' => null,
        'persistent' => true


For example, if you are using the attachment field to upload a file in a form, you can check for viruses using this code snippet in the related Table validationDefault method.

if (Configure::read('CakeDC/Clamav.enabled')) {
            if (!$validator->getProvider('clamd')) {
                $validator->setProvider('clamd', new ClamdValidation());
                    'rule' => 'fileHasNoVirusesFound',
                    'provider' => 'clamd',


For bugs and feature requests, please use the issues section of this repository.

Commercial support is also available, contact us for more information.


This repository follows the CakeDC Plugin Standard. If you'd like to contribute new features, enhancements or bug fixes to the plugin, please read our Contribution Guidelines for detailed instructions.


Copyright 2018 Cake Development Corporation (CakeDC). All rights reserved.

Licensed under the MIT License. Redistributions of the source code included in this repository must retain the copyright notice found in each file.