Symbiote\SteamedClams\ClamAV
Synopsis
class ClamAV
{
- // constants
- const MODULE_DIR = 'steamedclams';
- const OFFLINE = false;
- // members
- private static string $initial_scan_ignore_before_datetime = '1970-12-25 00:00:00';
- private static boolean $deny_on_failure = false;
- private static array $clamd = ;
- protected ClamdBase $clamd_instance = NULL;
- protected ClamdException $last_exception = NULL;
- protected boolean|null $_cache_isOffline = NULL;
- // methods
- public ClamAVScan|null scanFileRecordForVirus()
- public boolean|null beforeHandleMissingFile()
- public ClamAVScan|null scanFileForVirus()
- protected array|false fileScan()
- protected ClamdBase getClamd()
- protected void setLastExceptionAndLog()
- protected string getIP()
- public boolean|null afterHandleMissingFile()
- public DataList|Arraylist getInitialFileToScanList()
- public DataList getBaseFileList()
- public ArrayList|DataList getFailedToScanFileList()
- public boolean isOffline()
- public string version()
- public ClamdException getLastException()
Hierarchy
Uses
- SilverStripe\Core\Injector\Injectable
- SilverStripe\Core\Config\Configurable
Constants
Name | Value |
---|---|
MODULE_DIR | 'steamedclams' |
OFFLINE | false |
Members
private
- $clamd
—
array
Settings that must be identical to your clamd.conf file. -
$deny_on_failure
If enabled, if ClamAV daemon isn't running or isn't installed the file will be denied as if it has a virus. - $initial_scan_ignore_before_datetime
—
string
Configure this to ignore `File` records created before the date provided.
protected
- $_cache_isOffline — Symbiote\SteamedClams\boolean|null
- $clamd_instance — \ClamdBase
- $last_exception — \ClamdException
Methods
protected
- fileScan() — Scan for virus, return array() if ClamAV daemon is running and returns false if it is not (or an error occurred connecting to the socket)
- getClamd() — Return underlying Clamd implementation.
- getIP() — Get the current users IP address
- setLastExceptionAndLog() — Set exception, if it has a non-falsey value, log it.
public
- afterHandleMissingFile() — If file didn't exist on local machine and downloaded from CDN, we want to re-remove it.
- beforeHandleMissingFile() — If file doesn't exist on local machine, try to download from a CDN module or similar.
- getBaseFileList()
- getFailedToScanFileList() — Get list of files that couldn't be scanned when uploaded due to ClamAV daemon being down or not properly configured ie. after installation of module
- getInitialFileToScanList() — Get list of files that haven't been checked at all.
- getLastException() — Get the last exception caught by this.
- isOffline()
- scanFileForVirus()
- scanFileRecordForVirus()
- version()