ILIAS  release_7 Revision v7.30-3-g800a261c036
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)
 @inheritDoc More...
 

Protected Attributes

 $config
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

ilVirusScannerConfigStoredObjective::__construct ( \ilVirusScannerSetupConfig  $config)

Member Function Documentation

◆ achieve()

ilVirusScannerConfigStoredObjective::achieve ( Setup\Environment  $environment)

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

42 : Setup\Environment
43 {
44 $ini = $environment->getResource(Setup\Environment::RESOURCE_ILIAS_INI);
45
46 $ini->setVariable("tools", "vscantype", $this->config->getVirusScanner());
47 $ini->setVariable("tools", "scancommand", $this->config->getPathToScan());
48 $ini->setVariable("tools", "cleancommand", $this->config->getPathToClean());
49 $ini->setVariable("tools", "icap_host", $this->config->getIcapHost());
50 $ini->setVariable("tools", "icap_port", $this->config->getIcapPort());
51 $ini->setVariable("tools", "icap_service_name", $this->config->getIcapServiceName());
52 $ini->setVariable("tools", "icap_client_path", $this->config->getIcapClientPath());
53
54 if (!$ini->write()) {
55 throw new Setup\UnachievableException("Could not write ilias.ini.php");
56 }
57
58 return $environment;
59 }
$ini
Definition: raiseError.php:4

References $ini.

◆ getHash()

ilVirusScannerConfigStoredObjective::getHash ( )

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

20 : string
21 {
22 return hash("sha256", self::class);
23 }

◆ getLabel()

ilVirusScannerConfigStoredObjective::getLabel ( )

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

25 : string
26 {
27 return "Fill ini with settings for Services/VirusScanner";
28 }

◆ getPreconditions()

ilVirusScannerConfigStoredObjective::getPreconditions ( Setup\Environment  $environment)

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

35 : array
36 {
37 return [
39 ];
40 }

◆ isApplicable()

ilVirusScannerConfigStoredObjective::isApplicable ( Setup\Environment  $environment)

@inheritDoc

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

64 : bool
65 {
66 $ini = $environment->getResource(Setup\Environment::RESOURCE_ILIAS_INI);
67
68 return
69 $ini->readVariable("tools", "vscantype") !== $this->config->getVirusScanner() ||
70 $ini->readVariable("tools", "scancommand") !== $this->config->getPathToScan() ||
71 $ini->readVariable("tools", "cleancommand") !== $this->config->getPathToClean() ||
72 $ini->readVariable("tools", "icap_host") !== $this->config->getIcapHost() ||
73 $ini->readVariable("tools", "icap_port") !== $this->config->getIcapPort() ||
74 $ini->readVariable("tools", "icap_service_name") !== $this->config->getIcapServiceName() ||
75 $ini->readVariable("tools", "icap_client_path") !== $this->config->getIcapClientPath()
76 ;
77 }

References $ini.

◆ isNotable()

ilVirusScannerConfigStoredObjective::isNotable ( )

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

30 : bool
31 {
32 return false;
33 }

Field Documentation

◆ $config

ilVirusScannerConfigStoredObjective::$config
protected

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

Referenced by __construct().


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