ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilVirusScannerFactory.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 {
23  public static function _getInstance(): ?ilVirusScanner
24  {
25  $vs = null;
26 
27  if (IL_VIRUS_SCANNER === "icap") {
28  if (strlen(IL_ICAP_CLIENT) > 0) {
29  $vs = new ilVirusScannerICapClient('', '');
30  } else {
31  $vs = new ilVirusScannerICapRemoteAvClient('', '');
32  }
33  } else {
34  switch (IL_VIRUS_SCANNER) {
35  case "Sophos":
36  $vs = new ilVirusScannerSophos(IL_VIRUS_SCAN_COMMAND, IL_VIRUS_CLEAN_COMMAND);
37  break;
38  case "AntiVir":
39  global $DIC;
40  $DIC->logger()->root()->error('AntiVir is deprecated, please install and use a different virus scanner.');
41  $vs = new ilVirusScannerAntiVir(IL_VIRUS_SCAN_COMMAND, IL_VIRUS_CLEAN_COMMAND);
42  break;
43  case "ClamAV":
44  $vs = new ilVirusScannerClamAV(IL_VIRUS_SCAN_COMMAND, IL_VIRUS_CLEAN_COMMAND);
45  break;
46  }
47  }
48  return $vs;
49  }
50 }
global $DIC
Definition: feed.php:28