ILIAS  trunk Revision v11.0_alpha-1761-g6dbbfa7b760
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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.

References $config.

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

Member Function Documentation

◆ achieve()

ilVirusScannerConfigStoredObjective::achieve ( Setup\Environment  $environment)

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

References $ini.

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:20

◆ 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 components/ILIAS/VirusScanner_';
41  }

◆ getPreconditions()

ilVirusScannerConfigStoredObjective::getPreconditions ( Setup\Environment  $environment)
Returns
ilIniFilesLoadedObjective[]

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

51  : array
52  {
53  return [
55  ];
56  }

◆ isApplicable()

ilVirusScannerConfigStoredObjective::isApplicable ( Setup\Environment  $environment)

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

References $ini.

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  }
$ini
Definition: raiseError.php:20

◆ 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: