ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
ilLoggingConfigStoredObjective Class Reference
+ Inheritance diagram for ilLoggingConfigStoredObjective:
+ Collaboration diagram for ilLoggingConfigStoredObjective:

Public Member Functions

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

Protected Attributes

 $config
 

Detailed Description

Definition at line 8 of file class.ilLoggingConfigStoredObjective.php.

Constructor & Destructor Documentation

◆ __construct()

ilLoggingConfigStoredObjective::__construct ( \ilLoggingSetupConfig  $config)

Definition at line 15 of file class.ilLoggingConfigStoredObjective.php.

References $config.

Member Function Documentation

◆ achieve()

ilLoggingConfigStoredObjective::achieve ( Setup\Environment  $environment)

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

References $ini.

43  : Setup\Environment
44  {
45  $ini = $environment->getResource(Setup\Environment::RESOURCE_ILIAS_INI);
46 
47  $ini->setVariable("log", "enabled", $this->config->isEnabled() ? "1" : "0");
48  $ini->setVariable("log", "path", dirname($this->config->getPathToLogfile()));
49  $ini->setVariable("log", "file", basename($this->config->getPathToLogfile()));
50  $ini->setVariable("log", "error_path", $this->config->getErrorlogDir());
51 
52  if (!$ini->write()) {
53  throw new Setup\UnachievableException("Could not write ilias.ini.php");
54  }
55 
56  return $environment;
57  }
$ini
Definition: raiseError.php:4

◆ getHash()

ilLoggingConfigStoredObjective::getHash ( )

Definition at line 21 of file class.ilLoggingConfigStoredObjective.php.

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

◆ getLabel()

ilLoggingConfigStoredObjective::getLabel ( )

Definition at line 26 of file class.ilLoggingConfigStoredObjective.php.

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

◆ getPreconditions()

ilLoggingConfigStoredObjective::getPreconditions ( Setup\Environment  $environment)

Definition at line 36 of file class.ilLoggingConfigStoredObjective.php.

36  : array
37  {
38  return [
40  ];
41  }

◆ isApplicable()

ilLoggingConfigStoredObjective::isApplicable ( Setup\Environment  $environment)

Definition at line 62 of file class.ilLoggingConfigStoredObjective.php.

References $ini.

62  : bool
63  {
64  $ini = $environment->getResource(Setup\Environment::RESOURCE_ILIAS_INI);
65  $enabled = $this->config->isEnabled() ? "1" : "0";
66 
67  return
68  $ini->readVariable("log", "path") !== dirname($this->config->getPathToLogfile()) ||
69  $ini->readVariable("log", "file") !== basename($this->config->getPathToLogfile()) ||
70  $ini->readVariable("log", "error_path") !== $this->config->getErrorlogDir() ||
71  $ini->readVariable("log", "enabled") !== $enabled
72  ;
73  }
$ini
Definition: raiseError.php:4

◆ isNotable()

ilLoggingConfigStoredObjective::isNotable ( )

Definition at line 31 of file class.ilLoggingConfigStoredObjective.php.

31  : bool
32  {
33  return false;
34  }

Field Documentation

◆ $config

ilLoggingConfigStoredObjective::$config
protected

Definition at line 13 of file class.ilLoggingConfigStoredObjective.php.

Referenced by __construct().


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