ILIAS  trunk Revision v11.0_alpha-1846-g895b5f47236
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilChatroomServerConfigStoredObjective Class Reference
+ Inheritance diagram for ilChatroomServerConfigStoredObjective:
+ Collaboration diagram for ilChatroomServerConfigStoredObjective:

Public Member Functions

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

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilChatroomServerConfigStoredObjective::__construct ( protected ilChatroomSetupConfig  $config)

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

27  {
28  }

Member Function Documentation

◆ achieve()

ilChatroomServerConfigStoredObjective::achieve ( Setup\Environment  $environment)

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

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

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

◆ getHash()

ilChatroomServerConfigStoredObjective::getHash ( )

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

30  : string
31  {
32  return hash("sha256", self::class);
33  }

◆ getLabel()

ilChatroomServerConfigStoredObjective::getLabel ( )

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

35  : string
36  {
37  return "Store information about chatroom server to db";
38  }

◆ getPreconditions()

ilChatroomServerConfigStoredObjective::getPreconditions ( Setup\Environment  $environment)

◆ isApplicable()

ilChatroomServerConfigStoredObjective::isApplicable ( Setup\Environment  $environment)

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

111  : bool
112  {
113  return $this->config->getAddress() !== '' && $this->config->getPort() > 0;
114  }

◆ isNotable()

ilChatroomServerConfigStoredObjective::isNotable ( )

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

40  : bool
41  {
42  return true;
43  }

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