ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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)
 
 getVirusScanner ()
 
 getPathToScan ()
 
 getPathToClean ()
 

Data Fields

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

Protected Member Functions

 toLinuxConvention (?string $p)
 

Protected Attributes

 $virus_scanner
 
 $path_to_scan
 
 $path_to_clean
 

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 
)

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

References $virus_scanner, and toLinuxConvention().

34  {
35  $scanners = [
36  self::VIRUS_SCANNER_NONE,
37  self::VIRUS_SCANNER_SOPHOS,
38  self::VIRUS_SCANNER_ANTIVIR,
39  self::VIRUS_SCANNER_CLAMAV
40  ];
41  if (!in_array($virus_scanner, $scanners)) {
42  throw new \InvalidArgumentException(
43  "Unknown virus scanner: '$virus_scanner'"
44  );
45  }
46  if ($virus_scanner !== self::VIRUS_SCANNER_NONE && (!$path_to_scan || !$path_to_clean)) {
47  throw new \InvalidArgumentException(
48  "Missing path to scan and/or clean commands for virus scanner."
49  );
50  }
51  $this->virus_scanner = $virus_scanner;
52  $this->path_to_scan = $this->toLinuxConvention($path_to_scan);
53  $this->path_to_clean = $this->toLinuxConvention($path_to_clean);
54  }
+ Here is the call graph for this function:

Member Function Documentation

◆ getPathToClean()

ilVirusScannerSetupConfig::getPathToClean ( )

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

References $path_to_clean.

74  : ?string
75  {
76  return $this->path_to_clean;
77  }

◆ getPathToScan()

ilVirusScannerSetupConfig::getPathToScan ( )

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

References $path_to_scan.

69  : ?string
70  {
71  return $this->path_to_scan;
72  }

◆ getVirusScanner()

ilVirusScannerSetupConfig::getVirusScanner ( )

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

References $virus_scanner.

64  : string
65  {
66  return $this->virus_scanner;
67  }

◆ toLinuxConvention()

ilVirusScannerSetupConfig::toLinuxConvention ( ?string  $p)
protected

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

Referenced by __construct().

56  : ?string
57  {
58  if (!$p) {
59  return null;
60  }
61  return preg_replace("/\\\\/", "/", $p);
62  }
+ Here is the caller graph for this function:

Field Documentation

◆ $path_to_clean

ilVirusScannerSetupConfig::$path_to_clean
protected

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

Referenced by getPathToClean().

◆ $path_to_scan

ilVirusScannerSetupConfig::$path_to_scan
protected

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

Referenced by getPathToScan().

◆ $virus_scanner

ilVirusScannerSetupConfig::$virus_scanner
protected

Definition at line 18 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_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: