ILIAS  release_8 Revision v8.24
ilVirusScannerConfigStoredObjective Class Reference
+ Inheritance diagram for ilVirusScannerConfigStoredObjective:
+ Collaboration diagram for ilVirusScannerConfigStoredObjective:

Public Member Functions

 __construct (ilVirusScannerSetupConfig $config)
 
 getHash ()
 
 getLabel ()
 
 isNotable ()
 
 getPreconditions (Setup\Environment $environment)
 
 achieve (Setup\Environment $environment)
 
 isApplicable (Setup\Environment $environment)
 

Protected Attributes

ilVirusScannerSetupConfig $config
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilVirusScannerConfigStoredObjective::__construct ( ilVirusScannerSetupConfig  $config)

Definition at line 27 of file class.ilVirusScannerConfigStoredObjective.php.

29 {
30 $this->config = $config;
31 }

References $config.

Member Function Documentation

◆ achieve()

ilVirusScannerConfigStoredObjective::achieve ( Setup\Environment  $environment)

Definition at line 58 of file class.ilVirusScannerConfigStoredObjective.php.

58 : Setup\Environment
59 {
60 $ini = $environment->getResource(Setup\Environment::RESOURCE_ILIAS_INI);
61
62 $ini->setVariable("tools", "vscantype", $this->config->getVirusScanner());
63 $ini->setVariable("tools", "scancommand", (string) $this->config->getPathToScan());
64 $ini->setVariable("tools", "cleancommand", (string) $this->config->getPathToClean());
65 $ini->setVariable("tools", "icap_host", (string) $this->config->getIcapHost());
66 $ini->setVariable("tools", "icap_port", (string) $this->config->getIcapPort());
67 $ini->setVariable("tools", "icap_service_name", (string) $this->config->getIcapServiceName());
68 $ini->setVariable("tools", "icap_client_path", (string) $this->config->getIcapClientPath());
69
70 if (!$ini->write()) {
71 throw new Setup\UnachievableException("Could not write ilias.ini.php");
72 }
73
74 return $environment;
75 }
$ini
Definition: raiseError.php:4

References $ini.

◆ getHash()

ilVirusScannerConfigStoredObjective::getHash ( )

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

33 : string
34 {
35 return hash("sha256", self::class);
36 }

◆ getLabel()

ilVirusScannerConfigStoredObjective::getLabel ( )

Definition at line 38 of file class.ilVirusScannerConfigStoredObjective.php.

38 : string
39 {
40 return "Fill ini with settings for Services/VirusScanner";
41 }

◆ getPreconditions()

ilVirusScannerConfigStoredObjective::getPreconditions ( Setup\Environment  $environment)

◆ isApplicable()

ilVirusScannerConfigStoredObjective::isApplicable ( Setup\Environment  $environment)

Definition at line 77 of file class.ilVirusScannerConfigStoredObjective.php.

77 : bool
78 {
79 $ini = $environment->getResource(Setup\Environment::RESOURCE_ILIAS_INI);
80
81 return
82 $ini->readVariable("tools", "vscantype") !== $this->config->getVirusScanner() ||
83 $ini->readVariable("tools", "scancommand") !== $this->config->getPathToScan() ||
84 $ini->readVariable("tools", "cleancommand") !== $this->config->getPathToClean() ||
85 $ini->readVariable("tools", "icap_host") !== $this->config->getIcapHost() ||
86 $ini->readVariable("tools", "icap_port") !== $this->config->getIcapPort() ||
87 $ini->readVariable("tools", "icap_service_name") !== $this->config->getIcapServiceName() ||
88 $ini->readVariable("tools", "icap_client_path") !== $this->config->getIcapClientPath();
89 }

References $ini.

◆ isNotable()

ilVirusScannerConfigStoredObjective::isNotable ( )

Definition at line 43 of file class.ilVirusScannerConfigStoredObjective.php.

43 : bool
44 {
45 return false;
46 }

Field Documentation

◆ $config

ilVirusScannerSetupConfig ilVirusScannerConfigStoredObjective::$config
protected

Definition at line 25 of file class.ilVirusScannerConfigStoredObjective.php.

Referenced by __construct().


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