ILIAS
release_8 Revision v8.19
◀ ilDoc Overview
Main Page
Related Pages
Modules
+
Namespaces
Namespace List
+
Namespace Members
+
All
$
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
u
v
w
x
+
Functions
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
+
Variables
$
a
b
c
d
e
f
g
h
j
l
m
p
s
t
u
+
Data Structures
Data Structures
Data Structure Index
Class Hierarchy
+
Data Fields
+
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Ö
+
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Variables
$
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Ö
+
Files
File List
+
Globals
+
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
z
+
Functions
_
a
b
c
d
e
g
h
i
m
n
p
r
s
t
u
v
x
+
Variables
$
a
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
z
Examples
•
All
Data Structures
Namespaces
Files
Functions
Variables
Modules
Pages
class.ilVirusScannerPreProcessor.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
21
use
ILIAS\Filesystem\Stream\FileStream
;
22
use
ILIAS\FileUpload\DTO\Metadata
;
23
use
ILIAS\FileUpload\DTO\ProcessingStatus
;
24
use
ILIAS\FileUpload\Processor\PreProcessor
;
25
26
final
class
ilVirusScannerPreProcessor
implements
PreProcessor
27
{
28
protected \ilVirusScanner
$scanner
;
29
30
public
function
__construct
(
ilVirusScanner
$scanner)
31
{
32
$this->scanner =
$scanner
;
33
}
34
35
public
function
process
(
FileStream
$stream,
Metadata
$metadata):
ProcessingStatus
36
{
37
$uri = $stream->getMetadata()[
"uri"
];
38
// chmod($uri, 0755); // we must find a way e.g. ClamAV can read the file
39
if
($this->scanner->scanFile($uri) !==
""
) {
40
return
new
ProcessingStatus
(ProcessingStatus::DENIED,
'Virus detected.'
);
41
}
42
43
return
new
ProcessingStatus
(ProcessingStatus::OK,
'No Virus detected.'
);
44
}
45
}
ILIAS\FileUpload\Processor\PreProcessor
Class PreProcessor.
Definition:
PreProcessor.php:35
ilVirusScannerPreProcessor
Definition:
class.ilVirusScannerPreProcessor.php:26
ILIAS\FileUpload\DTO\ProcessingStatus
Class ProcessingStatus.
Definition:
ProcessingStatus.php:36
ProcessingStatus
ilVirusScannerPreProcessor\process
process(FileStream $stream, Metadata $metadata)
This method gets invoked by the file upload service to process the file with the help of the processo...
Definition:
class.ilVirusScannerPreProcessor.php:35
ILIAS\FileUpload\DTO\Metadata
Class Metadata.
Definition:
Metadata.php:21
ilVirusScannerPreProcessor\$scanner
ilVirusScanner $scanner
Definition:
class.ilVirusScannerPreProcessor.php:28
ilVirusScannerPreProcessor\__construct
__construct(ilVirusScanner $scanner)
Definition:
class.ilVirusScannerPreProcessor.php:30
ilVirusScanner
Definition:
class.ilVirusScanner.php:21
Metadata
FileStream
ILIAS\Filesystem\Stream\FileStream
Interface FileStream.
Definition:
FileStream.php:33
PreProcessor
Services
VirusScanner
classes
class.ilVirusScannerPreProcessor.php
Generated on Sun Apr 13 2025 22:02:49 for ILIAS by
1.8.13 (using
Doxyfile
)