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

 $config
 

Detailed Description

Store information about https is enabled.

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

Constructor & Destructor Documentation

◆ __construct()

ilChatroomServerConfigStoredObjective::__construct ( \ilChatroomSetupConfig  $config)

Member Function Documentation

◆ achieve()

ilChatroomServerConfigStoredObjective::achieve ( Setup\Environment  $environment)

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

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

47  : Setup\Environment
48  {
49  $db = $environment->getResource(Setup\Environment::RESOURCE_DATABASE);
50  $common_config = $environment->getConfigFor("common");
51  $filesystem_config = $environment->getConfigFor("filesystem");
52 
53  // ATTENTION: This is a total abomination. It only exists to allow various
54  // sub components of the various readers to run. This is a memento to the
55  // fact, that dependency injection is something we want. Currently, every
56  // component could just service locate the whole world via the global $DIC.
57  $DIC = $GLOBALS["DIC"];
58  $GLOBALS["DIC"] = new DI\Container();
59  $GLOBALS["DIC"]["ilDB"] = $db;
60  $GLOBALS["DIC"]["ilBench"] = null;
61 
62  $chatAdministrations = ilObject::_getObjectsByType('chta');
63  $chatAdministration = current($chatAdministrations);
64 
65  $chat_admin = new ilChatroomAdmin((int) $chatAdministration['obj_id']);
66  $settings = $chat_admin->loadGeneralSettings();
67 
68  $settings['address'] = $this->config->getAddress();
69  $settings['port'] = $this->config->getPort();
70  $settings['sub_directory'] = $this->config->getSubDirectory();
71  $settings['protocol'] = $this->config->getProtocol();
72  $settings['cert'] = $this->config->getCert();
73  $settings['key'] = $this->config->getKey();
74  $settings['dhparam'] = $this->config->getDhparam();
75  $settings['log'] = $this->config->getLog();
76  $settings['log_level'] = $this->config->getLogLevel();
77  $settings['error_log'] = $this->config->getErrorLog();
78  $settings['ilias_proxy'] = (int) $this->config->hasIliasProxy();
79  $settings['ilias_url'] = $this->config->getIliasUrl();
80  $settings['client_proxy'] = (int) $this->config->hasClientProxy();
81  $settings['client_url'] = $this->config->getClientUrl();
82  $settings['deletion_mode'] = (int) $this->config->hasDeletionMode();
83  $settings['deletion_unit'] = $this->config->getDeletionUnit();
84  $settings['deletion_value'] = $this->config->getDeletionValue();
85  $settings['deletion_time'] = $this->config->getDeletionTime();
86 
87  $chat_admin->saveGeneralSettings((object) $settings);
88 
89  if (!defined("CLIENT_DATA_DIR")) {
90  define(
91  "CLIENT_DATA_DIR",
92  $filesystem_config->getDataDir() . "/" . $common_config->getClientId()
93  );
94  }
95 
96  $fileHandler = new ilChatroomConfigFileHandler();
97  $fileHandler->createServerConfigFile($settings);
98 
99  $GLOBALS["DIC"] = $DIC;
100 
101  return $environment;
102  }
static _getObjectsByType($a_obj_type="", $a_owner="")
Get objects by type.
Class ilChatroomAdmin.
global $DIC
Definition: goto.php:24
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 23 of file class.ilChatroomServerConfigStoredObjective.php.

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

◆ getLabel()

ilChatroomServerConfigStoredObjective::getLabel ( )

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

28  : string
29  {
30  return "Store information about chatroom server to db";
31  }

◆ getPreconditions()

ilChatroomServerConfigStoredObjective::getPreconditions ( Setup\Environment  $environment)

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

38  : array
39  {
40  return [
41  new \ilIniFilesLoadedObjective(),
42  new \ilDatabaseInitializedObjective(),
43  new \ilFileSystemComponentDataDirectoryCreatedObjective("chatroom")
44  ];
45  }

◆ isApplicable()

ilChatroomServerConfigStoredObjective::isApplicable ( Setup\Environment  $environment)

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

107  : bool
108  {
109  return $this->config->getAddress() != '' && $this->config->getPort() != 0;
110  }

◆ isNotable()

ilChatroomServerConfigStoredObjective::isNotable ( )

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

33  : bool
34  {
35  return true;
36  }

Field Documentation

◆ $config

ilChatroomServerConfigStoredObjective::$config
protected

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

Referenced by __construct().


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