ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables 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"
 

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"
 
const VIRUS_SCANNER_ICAP = "icap"
 

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

References $icap_client_path.

119  : ?string
120  {
122  }

◆ getIcapHost()

ilVirusScannerSetupConfig::getIcapHost ( )

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

References $icap_host.

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

◆ getIcapPort()

ilVirusScannerSetupConfig::getIcapPort ( )

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

References $icap_port.

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

◆ getIcapServiceName()

ilVirusScannerSetupConfig::getIcapServiceName ( )

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

References $icap_service_name.

114  : ?string
115  {
117  }

◆ getPathToClean()

ilVirusScannerSetupConfig::getPathToClean ( )

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

References $path_to_clean.

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

◆ getPathToScan()

ilVirusScannerSetupConfig::getPathToScan ( )

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

References $path_to_scan.

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

◆ getVirusScanner()

ilVirusScannerSetupConfig::getVirusScanner ( )

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

References $virus_scanner.

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

◆ toLinuxConvention()

ilVirusScannerSetupConfig::toLinuxConvention ( ?string  $p)
protected

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

Referenced by __construct().

81  : ?string
82  {
83  if (!$p) {
84  return null;
85  }
86  return preg_replace("/\\\\/", "/", $p);
87  }
+ 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"
private

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