All Projects → kissit → php-clamav-scan

kissit / php-clamav-scan

Licence: BSD-2-Clause license
A simple PHP library for ClamAV that is CodeIgniter compatible

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to php-clamav-scan

Web
Source Code of www.codeigniter.org.tw
Stars: ✭ 13 (-62.86%)
Mutual labels:  codeigniter
angular-openid-connect-php
Angular & PHP CodeIgniter server through OAuth 2.0 OpenID Connect
Stars: ✭ 14 (-60%)
Mutual labels:  codeigniter
ClamAV.Managed
ClamAV bindings for the .NET Framework, Mono and PowerShell. ClamAV.Managed is a library written in C# for the .NET Framework and Mono, providing managed bindings for the libclamav interface. It includes ClamAV.Managed.PowerShell, a set of PowerShell cmdlets for ClamAV scanning. It comes with sample code for building a GUI virus scanner applicat…
Stars: ✭ 15 (-57.14%)
Mutual labels:  clamav
Kalkun
Open Source Web based SMS Manager
Stars: ✭ 186 (+431.43%)
Mutual labels:  codeigniter
php-clamav
ClamAV network and pipe client for PHP
Stars: ✭ 45 (+28.57%)
Mutual labels:  clamav
codeigniter-log-viewer
This is a simple Log Viewer for viewing Code Igniter logs on the browser and via API clients
Stars: ✭ 80 (+128.57%)
Mutual labels:  codeigniter
online-games-store
Simple e-commerce proejct built with Codeigniter 3
Stars: ✭ 49 (+40%)
Mutual labels:  codeigniter
clamfs
ClamFS is a FUSE-based user-space file system for Linux and BSD with on-access anti-virus file scanning
Stars: ✭ 29 (-17.14%)
Mutual labels:  clamav
Codeigniter-4-CRUD-generator
ADEL CCG is an easy open-source intuitive web app to create AdminLTE4 -Bootstrap 5- dashboards with CRUD operations in php.
Stars: ✭ 87 (+148.57%)
Mutual labels:  codeigniter
powerorm
A very simple but effective php orm
Stars: ✭ 21 (-40%)
Mutual labels:  codeigniter
Adware-ads-network-server
Online Advertising Network Server
Stars: ✭ 44 (+25.71%)
Mutual labels:  codeigniter
cszcms
Open Source CMS (Content Management System) with Codeigniter and Bootstrap.
Stars: ✭ 47 (+34.29%)
Mutual labels:  codeigniter
mailserver
Simple and full-featured mail server using Docker
Stars: ✭ 88 (+151.43%)
Mutual labels:  clamav
sistem skripsi
Proses skripsi menjadi lebih teratur dan cepat yang dilakukan secara online yang bisa diakses dimana saja melalui browser dengan bertujuan menghemat waktu, tenaga dan memudahkan mendapatkan informasi proses skripsi secara Online.
Stars: ✭ 23 (-34.29%)
Mutual labels:  codeigniter
codeigniter3-filename-checker
CodeIgniter3 Filename Checker
Stars: ✭ 21 (-40%)
Mutual labels:  codeigniter
clamd
Golang clamd (clamav daemon) client library
Stars: ✭ 23 (-34.29%)
Mutual labels:  clamav
portal-news
Portal news project built with Codeigniter 3
Stars: ✭ 46 (+31.43%)
Mutual labels:  codeigniter
simple-codeigniter-rest-api
🔥 Simple PHP code using Codeigniter framework for building Rest API
Stars: ✭ 60 (+71.43%)
Mutual labels:  codeigniter
e-learningCodeigniter
E-learning web app with admin panel, Codeigniter Framework
Stars: ✭ 34 (-2.86%)
Mutual labels:  codeigniter
user-registration-codeigniter
PHP based user registration system. Built using CodeIgniter and Bootstrap. Has token based verification, password reset functionality, login page, register page and more.
Stars: ✭ 61 (+74.29%)
Mutual labels:  codeigniter

php-clamav-scan

A simple PHP class for scanning files using a LOCAL ClamAV/clamd install either via a socket file or network socket (windows). Can either be used on its own or dropped into a Codeigniter app as a library. The main reason this was created was because the legacy php-clamav module is not compatible with PHP 7 and all other options I found were either not drop in compatible with CodeIgniter or were designed for use with Composer. Such a trivial task/library should not be that difficult.

As previously mentioned, the files are scanned using their full path so clamd needs to be run on the web server. Even when using a network socket, the class does not handle the streaming of files over the network in a client/server model(yet). I didn't have a need to do scans over the network but support could easily be added. That being said, it requires the PHP Sockets module be installed. If not already present you must install it based on your system.

To use this on Windows, you must use the network socket option. As far as I'm aware the Windows version of Clamd does not support sockets.

Example standalone usage:

  • Include the class
require 'Clamav.php';
  • Instantiate an object.
$clamav = new Clamav();
  • If you need to customize the Clamd socket path you can do so
$clamav = new Clamav(array('clamd_sock' => '/path/to/clamd.sock'));
  • Scan a file
if($clamav->scan("/path/to/file/to/scan.txt")) {
    echo "YAY, file is safe\n";
} else {
    echo "BOO, file is a virus.  Message: " . $clamav->getMessage() . "\n";
}

Example CodeIgniter Usage

  • Download the file into your application/libraries directory
  • Load the library where desired
$this->load->library('clamav');
  • If you need to customize the Clamd socket path you can do so
$this->load->library('clamav', array('clamd_sock' => '/path/to/clamd.sock'));
  • Scan a file
if($this->clamav->scan("/path/to/file/to/scan.txt")) {
    echo "YAY, file is safe\n";
} else {
    echo "BOO, file is a virus.  Message: " . $clamav->getMessage() . "\n";
}

Example Network Socket Usage

Everything is the same to use a network socket other than you must pass in at least the IP when instantiating the object. You can also include an optional port if you are using something other than the standard 3310.

$clamav = new Clamav(array('clamd_sock' => '/path/to/clamd.sock'));
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].