ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
VirusScannerPreProcessor.php
Go to the documentation of this file.
1<?php
2
4
9
20{
21
25 protected $scanner;
26
27
34 {
35 $this->scanner = $scanner;
36 }
37
38
43 {
44 // $stream->rewind();
45 $uri = $stream->getMetadata()["uri"];
46 // chmod($uri, 0755); // we must find a way e.g. ClamAV can read the file
47 if ($this->scanner->scanFile($uri) !== "") {
48 return new ProcessingStatus(ProcessingStatus::REJECTED, 'Virus detected.');
49 }
50
51 return new ProcessingStatus(ProcessingStatus::OK, 'No Virus detected.');
52 }
53}
$metadata['__DYNAMIC:1__']
An exception for terminatinating execution or to throw for unit testing.
const REJECTED
Upload got rejected by a processor.
__construct(\ilVirusScanner $scanner)
VirusScannerPreProcessor constructor.
process(FileStream $stream, Metadata $metadata)
@inheritDoc
Base class for the interface to an external virus scanner This class is abstract and needs to be exte...
Describes a data stream.
$stream
PHP stream implementation.