ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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_ICAP = 'icap'
 

Protected Member Functions

 toLinuxConvention (?string $p)
 

Protected Attributes

string $virus_scanner
 
string $path_to_scan = null
 
string $path_to_clean = null
 
string $icap_host = null
 
string $icap_port = null
 
string $icap_service_name = null
 
string $icap_client_path = null
 

Private Attributes

const VIRUS_SCANNER_SOPHOS = 'sophos'
 
const VIRUS_SCANNER_ANTIVIR = 'antivir'
 
const VIRUS_SCANNER_CLAMAV = 'clamav'
 

Detailed Description

Definition at line 23 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 45 of file class.ilVirusScannerSetupConfig.php.

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

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 120 of file class.ilVirusScannerSetupConfig.php.

120 : ?string
121 {
123 }

References $icap_client_path.

◆ getIcapHost()

ilVirusScannerSetupConfig::getIcapHost ( )

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

105 : ?string
106 {
107 return $this->icap_host;
108 }

References $icap_host.

◆ getIcapPort()

ilVirusScannerSetupConfig::getIcapPort ( )

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

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

References $icap_port.

◆ getIcapServiceName()

ilVirusScannerSetupConfig::getIcapServiceName ( )

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

115 : ?string
116 {
118 }

References $icap_service_name.

◆ getPathToClean()

ilVirusScannerSetupConfig::getPathToClean ( )

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

100 : ?string
101 {
103 }

References $path_to_clean.

◆ getPathToScan()

ilVirusScannerSetupConfig::getPathToScan ( )

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

95 : ?string
96 {
98 }

References $path_to_scan.

◆ getVirusScanner()

ilVirusScannerSetupConfig::getVirusScanner ( )

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

90 : string
91 {
93 }

References $virus_scanner.

◆ toLinuxConvention()

ilVirusScannerSetupConfig::toLinuxConvention ( ?string  $p)
protected

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

81 : ?string
82 {
83 if (!$p) {
84 return null;
85 }
86
87 return preg_replace("/\\\\/", '/', $p);
88 }

Referenced by __construct().

+ Here is the caller graph for this function:

Field Documentation

◆ $icap_client_path

string ilVirusScannerSetupConfig::$icap_client_path = null
protected

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

Referenced by getIcapClientPath().

◆ $icap_host

string ilVirusScannerSetupConfig::$icap_host = null
protected

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

Referenced by getIcapHost().

◆ $icap_port

string ilVirusScannerSetupConfig::$icap_port = null
protected

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

Referenced by getIcapPort().

◆ $icap_service_name

string ilVirusScannerSetupConfig::$icap_service_name = null
protected

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

Referenced by getIcapServiceName().

◆ $path_to_clean

string ilVirusScannerSetupConfig::$path_to_clean = null
protected

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

Referenced by __construct(), and getPathToClean().

◆ $path_to_scan

string ilVirusScannerSetupConfig::$path_to_scan = null
protected

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

Referenced by __construct(), and getPathToScan().

◆ $virus_scanner

string ilVirusScannerSetupConfig::$virus_scanner
protected

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

Referenced by __construct(), and getVirusScanner().

◆ VIRUS_SCANNER_ANTIVIR

const ilVirusScannerSetupConfig::VIRUS_SCANNER_ANTIVIR = 'antivir'
private

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

Referenced by __construct().

◆ VIRUS_SCANNER_CLAMAV

const ilVirusScannerSetupConfig::VIRUS_SCANNER_CLAMAV = 'clamav'
private

Definition at line 28 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'
private

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

Referenced by __construct().


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