ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilVirusScannerSetupConfig Class Reference
+ Inheritance diagram for ilVirusScannerSetupConfig:
+ Collaboration diagram for ilVirusScannerSetupConfig:

Public Member Functions

 __construct (string $virus_scanner, ?string $path_to_scan, ?string $path_to_clean)
 
 getVirusScanner ()
 
 getPathToScan ()
 
 getPathToClean ()
 

Data Fields

const VIRUS_SCANNER_NONE = "none"
 
const VIRUS_SCANNER_SOPHOS = "sophos"
 
const VIRUS_SCANNER_ANTIVIR = "antivir"
 
const VIRUS_SCANNER_CLAMAV = "clamav"
 

Protected Member Functions

 toLinuxConvention (?string $p)
 

Protected Attributes

 $virus_scanner
 
 $path_to_scan
 
 $path_to_clean
 

Detailed Description

Definition at line 8 of file class.ilVirusScannerSetupConfig.php.

Constructor & Destructor Documentation

◆ __construct()

ilVirusScannerSetupConfig::__construct ( string  $virus_scanner,
?string  $path_to_scan,
?string  $path_to_clean 
)

Definition at line 30 of file class.ilVirusScannerSetupConfig.php.

34 {
35 $scanners = [
40 ];
41 if (!in_array($virus_scanner, $scanners)) {
42 throw new \InvalidArgumentException(
43 "Unknown virus scanner: '$virus_scanner'"
44 );
45 }
46 if ($virus_scanner !== self::VIRUS_SCANNER_NONE && (!$path_to_scan || !$path_to_clean)) {
47 throw new \InvalidArgumentException(
48 "Missing path to scan and/or clean commands for virus scanner."
49 );
50 }
51 $this->virus_scanner = $virus_scanner;
52 $this->path_to_scan = $this->toLinuxConvention($path_to_scan);
53 $this->path_to_clean = $this->toLinuxConvention($path_to_clean);
54 }

References $path_to_clean, $path_to_scan, $virus_scanner, toLinuxConvention(), VIRUS_SCANNER_ANTIVIR, VIRUS_SCANNER_CLAMAV, VIRUS_SCANNER_NONE, and VIRUS_SCANNER_SOPHOS.

+ Here is the call graph for this function:

Member Function Documentation

◆ getPathToClean()

ilVirusScannerSetupConfig::getPathToClean ( )

Definition at line 74 of file class.ilVirusScannerSetupConfig.php.

74 : ?string
75 {
77 }

References $path_to_clean.

◆ getPathToScan()

ilVirusScannerSetupConfig::getPathToScan ( )

Definition at line 69 of file class.ilVirusScannerSetupConfig.php.

69 : ?string
70 {
72 }

References $path_to_scan.

◆ getVirusScanner()

ilVirusScannerSetupConfig::getVirusScanner ( )

Definition at line 64 of file class.ilVirusScannerSetupConfig.php.

64 : string
65 {
67 }

References $virus_scanner.

◆ toLinuxConvention()

ilVirusScannerSetupConfig::toLinuxConvention ( ?string  $p)
protected

Definition at line 56 of file class.ilVirusScannerSetupConfig.php.

56 : ?string
57 {
58 if (!$p) {
59 return null;
60 }
61 return preg_replace("/\\\\/", "/", $p);
62 }

Referenced by __construct().

+ Here is the caller graph for this function:

Field Documentation

◆ $path_to_clean

ilVirusScannerSetupConfig::$path_to_clean
protected

Definition at line 28 of file class.ilVirusScannerSetupConfig.php.

Referenced by __construct(), and getPathToClean().

◆ $path_to_scan

ilVirusScannerSetupConfig::$path_to_scan
protected

Definition at line 23 of file class.ilVirusScannerSetupConfig.php.

Referenced by __construct(), and getPathToScan().

◆ $virus_scanner

ilVirusScannerSetupConfig::$virus_scanner
protected

Definition at line 18 of file class.ilVirusScannerSetupConfig.php.

Referenced by __construct(), and getVirusScanner().

◆ VIRUS_SCANNER_ANTIVIR

const ilVirusScannerSetupConfig::VIRUS_SCANNER_ANTIVIR = "antivir"

Definition at line 12 of file class.ilVirusScannerSetupConfig.php.

Referenced by __construct().

◆ VIRUS_SCANNER_CLAMAV

const ilVirusScannerSetupConfig::VIRUS_SCANNER_CLAMAV = "clamav"

Definition at line 13 of file class.ilVirusScannerSetupConfig.php.

Referenced by __construct().

◆ VIRUS_SCANNER_NONE

const ilVirusScannerSetupConfig::VIRUS_SCANNER_NONE = "none"

◆ VIRUS_SCANNER_SOPHOS

const ilVirusScannerSetupConfig::VIRUS_SCANNER_SOPHOS = "sophos"

Definition at line 11 of file class.ilVirusScannerSetupConfig.php.

Referenced by __construct().


The documentation for this class was generated from the following file: