Source of file ClamAVScanTask.php
Size: 1,413 Bytes - Last Modified: 2021-12-23T10:21:01+00:00
/var/www/docs.ssmods.com/process/src/src/Tasks/ClamAVScanTask.php
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 | <?php namespace Symbiote\SteamedClams\Tasks; use SilverStripe\Control\HTTPRequest; class ClamAVScanTask extends ClamAVBaseTask { /** * @var string */ protected $title = 'ClamAV Virus Scan Task'; /** * @var string */ protected $description = 'Scans files missed due to ClamAV daemon being unavailable at time of file upload.'; /** * Limit the `File` lists for testing purposes */ protected $debug_limit = 0; /** * @param HTTPRequest $request * @param null $job * * @return bool|void * @throws \Exception */ public function run($request, $job = null) { if (parent::run($request, $job) === false) { return; } $this->log('Starting ClamAV task...'); $list = $this->clamAV->getFailedToScanFileList(); $listCount = $list->count(); if ($listCount > 0) { $this->log('------------------------------------'); $this->log('Scanning the ' . $listCount . ' files that couldn\'t be scanned due to previous ClamAV daemon connectivity issues.'); $this->log('------------------------------------'); $this->scanListChunked($list, $this->debug_limit); $this->log('Finished ClamAV task.'); } else { $this->log('Finished ClamAV task. No action was required.'); } } } |