ILIAS  release_7 Revision v7.30-3-g800a261c036
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, ?string $icap_host, ?string $icap_port, ?string $icap_service_name, ?string $icap_client_path)
 
 getVirusScanner ()
 
 getPathToScan ()
 
 getPathToClean ()
 
 getIcapHost ()
 
 getIcapPort ()
 
 getIcapServiceName ()
 
 getIcapClientPath ()
 

Data Fields

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

Protected Member Functions

 toLinuxConvention (?string $p)
 

Protected Attributes

 $virus_scanner
 
 $path_to_scan
 
 $path_to_clean
 
 $icap_host
 
 $icap_port
 
 $icap_service_name
 
 $icap_client_path
 

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,
?string  $icap_host,
?string  $icap_port,
?string  $icap_service_name,
?string  $icap_client_path 
)

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

59 {
60 $scanners = [
66 ];
67 if (!in_array($virus_scanner, $scanners)) {
68 throw new \InvalidArgumentException(
69 "Unknown virus scanner: '$virus_scanner'"
70 );
71 }
72 if($virus_scanner === self::VIRUS_SCANNER_ICAP) {
73 $this->icap_host = $this->toLinuxConvention($icap_host);
74 $this->icap_port = $this->toLinuxConvention($icap_port);
75 $this->icap_service_name = $this->toLinuxConvention($icap_service_name);
76 $this->icap_client_path = $this->toLinuxConvention($icap_client_path);
77 } elseif ($virus_scanner !== self::VIRUS_SCANNER_NONE && (!$path_to_scan || !$path_to_clean)) {
78 throw new \InvalidArgumentException(
79 "Missing path to scan and/or clean commands for virus scanner."
80 );
81 }
82 $this->virus_scanner = $virus_scanner;
83 $this->path_to_scan = $this->toLinuxConvention($path_to_scan);
84 $this->path_to_clean = $this->toLinuxConvention($path_to_clean);
85 }

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

+ Here is the call graph for this function:

Member Function Documentation

◆ getIcapClientPath()

ilVirusScannerSetupConfig::getIcapClientPath ( )

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

125 : ?string
126 {
128 }

References $icap_client_path.

◆ getIcapHost()

ilVirusScannerSetupConfig::getIcapHost ( )

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

110 : ?string
111 {
112 return $this->icap_host;
113 }

References $icap_host.

◆ getIcapPort()

ilVirusScannerSetupConfig::getIcapPort ( )

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

115 : ?string
116 {
117 return $this->icap_port;
118 }

References $icap_port.

◆ getIcapServiceName()

ilVirusScannerSetupConfig::getIcapServiceName ( )

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

120 : ?string
121 {
123 }

References $icap_service_name.

◆ getPathToClean()

ilVirusScannerSetupConfig::getPathToClean ( )

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

105 : ?string
106 {
108 }

References $path_to_clean.

◆ getPathToScan()

ilVirusScannerSetupConfig::getPathToScan ( )

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

100 : ?string
101 {
102 return $this->path_to_scan;
103 }

References $path_to_scan.

◆ getVirusScanner()

ilVirusScannerSetupConfig::getVirusScanner ( )

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

95 : string
96 {
98 }

References $virus_scanner.

◆ toLinuxConvention()

ilVirusScannerSetupConfig::toLinuxConvention ( ?string  $p)
protected

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

87 : ?string
88 {
89 if (!$p) {
90 return null;
91 }
92 return preg_replace("/\\\\/", "/", $p);
93 }

Referenced by __construct().

+ Here is the caller graph for this function:

Field Documentation

◆ $icap_client_path

ilVirusScannerSetupConfig::$icap_client_path
protected

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

Referenced by getIcapClientPath().

◆ $icap_host

ilVirusScannerSetupConfig::$icap_host
protected

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

Referenced by getIcapHost().

◆ $icap_port

ilVirusScannerSetupConfig::$icap_port
protected

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

Referenced by getIcapPort().

◆ $icap_service_name

ilVirusScannerSetupConfig::$icap_service_name
protected

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

Referenced by getIcapServiceName().

◆ $path_to_clean

ilVirusScannerSetupConfig::$path_to_clean
protected

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

Referenced by __construct(), and getPathToClean().

◆ $path_to_scan

ilVirusScannerSetupConfig::$path_to_scan
protected

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

Referenced by __construct(), and getPathToScan().

◆ $virus_scanner

ilVirusScannerSetupConfig::$virus_scanner
protected

Definition at line 19 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_ICAP

const ilVirusScannerSetupConfig::VIRUS_SCANNER_ICAP = "icap"

◆ 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: