ILIAS  trunk Revision v11.0_alpha-1862-g4e205cb56d4
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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.

References $virus_scanner, and toLinuxConvention().

53  {
54  $scanners = [
55  self::VIRUS_SCANNER_NONE,
56  self::VIRUS_SCANNER_SOPHOS,
57  self::VIRUS_SCANNER_ANTIVIR,
58  self::VIRUS_SCANNER_CLAMAV,
59  self::VIRUS_SCANNER_ICAP
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  }
+ Here is the call graph for this function:

Member Function Documentation

◆ getIcapClientPath()

ilVirusScannerSetupConfig::getIcapClientPath ( )

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

References $icap_client_path.

120  : ?string
121  {
123  }

◆ getIcapHost()

ilVirusScannerSetupConfig::getIcapHost ( )

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

References $icap_host.

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

◆ getIcapPort()

ilVirusScannerSetupConfig::getIcapPort ( )

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

References $icap_port.

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

◆ getIcapServiceName()

ilVirusScannerSetupConfig::getIcapServiceName ( )

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

References $icap_service_name.

115  : ?string
116  {
118  }

◆ getPathToClean()

ilVirusScannerSetupConfig::getPathToClean ( )

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

References $path_to_clean.

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

◆ getPathToScan()

ilVirusScannerSetupConfig::getPathToScan ( )

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

References $path_to_scan.

95  : ?string
96  {
97  return $this->path_to_scan;
98  }

◆ getVirusScanner()

ilVirusScannerSetupConfig::getVirusScanner ( )

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

References $virus_scanner.

90  : string
91  {
92  return $this->virus_scanner;
93  }

◆ toLinuxConvention()

ilVirusScannerSetupConfig::toLinuxConvention ( ?string  $p)
protected

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

References null.

Referenced by __construct().

81  : ?string
82  {
83  if (!$p) {
84  return null;
85  }
86 
87  return preg_replace("/\\\\/", '/', $p);
88  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ 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 getPathToClean().

◆ $path_to_scan

string ilVirusScannerSetupConfig::$path_to_scan = null
protected

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

Referenced by 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.

◆ VIRUS_SCANNER_CLAMAV

const ilVirusScannerSetupConfig::VIRUS_SCANNER_CLAMAV = 'clamav'
private

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

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


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