ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilChatroomServerConfigStoredObjective Class Reference

Store information about https is enabled. More...

+ Inheritance diagram for ilChatroomServerConfigStoredObjective:
+ Collaboration diagram for ilChatroomServerConfigStoredObjective:

Public Member Functions

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

Protected Attributes

ilChatroomSetupConfig $config
 

Detailed Description

Store information about https is enabled.

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

Constructor & Destructor Documentation

◆ __construct()

ilChatroomServerConfigStoredObjective::__construct ( ilChatroomSetupConfig  $config)

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

References $config.

32  {
33  $this->config = $config;
34  }

Member Function Documentation

◆ achieve()

ilChatroomServerConfigStoredObjective::achieve ( Setup\Environment  $environment)

Definition at line 60 of file class.ilChatroomServerConfigStoredObjective.php.

References $DIC, $GLOBALS, ILIAS\LTI\ToolProvider\$settings, ilObject\_getObjectsByType(), ILIAS\Setup\Environment\getResource(), and ILIAS\Repository\int().

60  : Setup\Environment
61  {
62  $db = $environment->getResource(Setup\Environment::RESOURCE_DATABASE);
63  $common_config = $environment->getConfigFor("common");
64  $filesystem_config = $environment->getConfigFor("filesystem");
65 
66  // ATTENTION: This is a total abomination. It only exists to allow various
67  // sub components of the various readers to run. This is a memento to the
68  // fact, that dependency injection is something we want. Currently, every
69  // component could just service locate the whole world via the global $DIC.
70  $DIC = $GLOBALS["DIC"];
71  $GLOBALS["DIC"] = new DI\Container();
72  $GLOBALS["DIC"]["ilDB"] = $db;
73  $GLOBALS["DIC"]["ilBench"] = null;
74 
75  $chatAdministrations = ilObject::_getObjectsByType('chta');
76  $chatAdministration = current($chatAdministrations);
77 
78  $chat_admin = new ilChatroomAdmin((int) $chatAdministration['obj_id']);
79  $settings = $chat_admin->loadGeneralSettings();
80 
81  $settings['address'] = $this->config->getAddress();
82  $settings['port'] = $this->config->getPort();
83  $settings['sub_directory'] = $this->config->getSubDirectory();
84  $settings['protocol'] = $this->config->getProtocol();
85  $settings['cert'] = $this->config->getCert();
86  $settings['key'] = $this->config->getKey();
87  $settings['dhparam'] = $this->config->getDhparam();
88  $settings['log'] = $this->config->getLog();
89  $settings['log_level'] = $this->config->getLogLevel();
90  $settings['error_log'] = $this->config->getErrorLog();
91  $settings['ilias_proxy'] = (int) $this->config->hasIliasProxy();
92  $settings['ilias_url'] = $this->config->getIliasUrl();
93  $settings['client_proxy'] = (int) $this->config->hasClientProxy();
94  $settings['client_url'] = $this->config->getClientUrl();
95  $settings['deletion_mode'] = (int) $this->config->hasDeletionMode();
96  $settings['deletion_unit'] = $this->config->getDeletionUnit();
97  $settings['deletion_value'] = $this->config->getDeletionValue();
98  $settings['deletion_time'] = $this->config->getDeletionTime();
99 
100  $chat_admin->saveGeneralSettings((object) $settings);
101 
102  if (!defined("CLIENT_DATA_DIR")) {
103  define(
104  "CLIENT_DATA_DIR",
105  $filesystem_config->getDataDir() . "/" . ((string) $common_config->getClientId())
106  );
107  }
108 
109  $fileHandler = new ilChatroomConfigFileHandler();
110  $fileHandler->createServerConfigFile($settings);
111 
112  $GLOBALS["DIC"] = $DIC;
113 
114  return $environment;
115  }
array $settings
Setting values (LTI parameters, custom parameters and local parameters).
Definition: System.php:200
static _getObjectsByType(string $obj_type="", int $owner=null)
global $DIC
Definition: feed.php:28
Class ilChatroomAdmin.
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
+ Here is the call graph for this function:

◆ getHash()

ilChatroomServerConfigStoredObjective::getHash ( )

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

36  : string
37  {
38  return hash("sha256", self::class);
39  }

◆ getLabel()

ilChatroomServerConfigStoredObjective::getLabel ( )

Definition at line 41 of file class.ilChatroomServerConfigStoredObjective.php.

41  : string
42  {
43  return "Store information about chatroom server to db";
44  }

◆ getPreconditions()

ilChatroomServerConfigStoredObjective::getPreconditions ( Setup\Environment  $environment)

◆ isApplicable()

ilChatroomServerConfigStoredObjective::isApplicable ( Setup\Environment  $environment)

Definition at line 120 of file class.ilChatroomServerConfigStoredObjective.php.

120  : bool
121  {
122  return $this->config->getAddress() !== '' && $this->config->getPort() !== 0;
123  }

◆ isNotable()

ilChatroomServerConfigStoredObjective::isNotable ( )

Definition at line 46 of file class.ilChatroomServerConfigStoredObjective.php.

46  : bool
47  {
48  return true;
49  }

Field Documentation

◆ $config

ilChatroomSetupConfig ilChatroomServerConfigStoredObjective::$config
protected

Definition at line 29 of file class.ilChatroomServerConfigStoredObjective.php.

Referenced by __construct().


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