ILIAS  release_7 Revision v7.30-3-g800a261c036
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"
 
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.

References $virus_scanner, and toLinuxConvention().

59  {
60  $scanners = [
61  self::VIRUS_SCANNER_NONE,
62  self::VIRUS_SCANNER_SOPHOS,
63  self::VIRUS_SCANNER_ANTIVIR,
64  self::VIRUS_SCANNER_CLAMAV,
65  self::VIRUS_SCANNER_ICAP
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  }
+ Here is the call graph for this function:

Member Function Documentation

◆ getIcapClientPath()

ilVirusScannerSetupConfig::getIcapClientPath ( )

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

References $icap_client_path.

125  : ?string
126  {
128  }

◆ getIcapHost()

ilVirusScannerSetupConfig::getIcapHost ( )

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

References $icap_host.

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

◆ getIcapPort()

ilVirusScannerSetupConfig::getIcapPort ( )

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

References $icap_port.

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

◆ getIcapServiceName()

ilVirusScannerSetupConfig::getIcapServiceName ( )

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

References $icap_service_name.

120  : ?string
121  {
123  }

◆ getPathToClean()

ilVirusScannerSetupConfig::getPathToClean ( )

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

References $path_to_clean.

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

◆ getPathToScan()

ilVirusScannerSetupConfig::getPathToScan ( )

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

References $path_to_scan.

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

◆ getVirusScanner()

ilVirusScannerSetupConfig::getVirusScanner ( )

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

References $virus_scanner.

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

◆ toLinuxConvention()

ilVirusScannerSetupConfig::toLinuxConvention ( ?string  $p)
protected

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

Referenced by __construct().

87  : ?string
88  {
89  if (!$p) {
90  return null;
91  }
92  return preg_replace("/\\\\/", "/", $p);
93  }
+ 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 getPathToClean().

◆ $path_to_scan

ilVirusScannerSetupConfig::$path_to_scan
protected

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

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

◆ VIRUS_SCANNER_CLAMAV

const ilVirusScannerSetupConfig::VIRUS_SCANNER_CLAMAV = "clamav"

Definition at line 13 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"

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


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