ILIAS  release_7 Revision v7.30-3-g800a261c036
ilDatabaseUpdatedObjective Class Reference
+ Inheritance diagram for ilDatabaseUpdatedObjective:
+ Collaboration diagram for ilDatabaseUpdatedObjective:

Public Member Functions

 getHash ()
 
 getLabel ()
 
 isNotable ()
 
 getPreconditions (Setup\Environment $environment)
 
 achieve (Setup\Environment $environment)
 
 isApplicable (Setup\Environment $environment)
 @inheritDoc More...
 

Detailed Description

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

Member Function Documentation

◆ achieve()

ilDatabaseUpdatedObjective::achieve ( Setup\Environment  $environment)

Definition at line 34 of file class.ilDatabaseUpdatedObjective.php.

34 : Setup\Environment
35 {
36 $db = $environment->getResource(Setup\Environment::RESOURCE_DATABASE);
37 $io = $environment->getResource(Setup\Environment::RESOURCE_ADMIN_INTERACTION);
38 $ini = $environment->getResource(Setup\Environment::RESOURCE_ILIAS_INI);
39 $client_ini = $environment->getResource(Setup\Environment::RESOURCE_CLIENT_INI);
40 $client_id = $environment->getResource(Setup\Environment::RESOURCE_CLIENT_ID);
41
42 // ATTENTION: This is a total abomination. It only exists to allow the db-
43 // update to run. This is a memento to the fact, that dependency injection
44 // is something we want. Currently, every component could just service
45 // locate the whole world via the global $DIC.
46 $DIC = $GLOBALS["DIC"] ?? [];
47 $GLOBALS["DIC"] = new DI\Container();
48 $GLOBALS["DIC"]["ilDB"] = $db;
49 $GLOBALS["ilDB"] = $db;
50 $GLOBALS["DIC"]["ilBench"] = null;
51 $GLOBALS["DIC"]["ilLog"] = new class($io) {
52 public function __construct($io)
53 {
54 $this->io = $io;
55 }
56 public function write()
57 {
58 }
59 public function info()
60 {
61 }
62 public function warning($msg)
63 {
64 $this->io->inform($msg);
65 }
66 public function error($msg)
67 {
68 throw new Setup\UnachievableException(
69 "Problem in DB-Update: $msg"
70 );
71 }
72 };
73 $GLOBALS["ilLog"] = $GLOBALS["DIC"]["ilLog"];
74 $GLOBALS["DIC"]["ilLoggerFactory"] = new class() {
75 public function getRootLogger()
76 {
77 return new class() {
78 public function write()
79 {
80 }
81 };
82 }
83 };
84 $GLOBALS["ilCtrlStructureReader"] = new class() {
85 public function getStructure()
86 {
87 }
88 public function setIniFile()
89 {
90 }
91 };
92 if (!defined("CLIENT_DATA_DIR")) {
93 define("CLIENT_DATA_DIR", $ini->readVariable("clients", "datadir") . "/" . $client_id);
94 }
95 if (!defined("CLIENT_WEB_DIR")) {
96 define("CLIENT_WEB_DIR", dirname(__DIR__, 4) . "/data/" . $client_id);
97 }
98 if (!defined("ILIAS_ABSOLUTE_PATH")) {
99 define("ILIAS_ABSOLUTE_PATH", dirname(__FILE__, 5));
100 }
101 if (!defined("ILIAS_LOG_ENABLED")) {
102 define("ILIAS_LOG_ENABLED", false);
103 }
104 if (!defined("ROOT_FOLDER_ID")) {
105 define("ROOT_FOLDER_ID", $client_ini->readVariable("system", "ROOT_FOLDER_ID"));
106 }
107 if (!defined("ROLE_FOLDER_ID")) {
108 define("ROLE_FOLDER_ID", $client_ini->readVariable("system", "ROLE_FOLDER_ID"));
109 }
110 if (!defined("SYSTEM_FOLDER_ID")) {
111 define("SYSTEM_FOLDER_ID", $client_ini->readVariable("system", "SYSTEM_FOLDER_ID"));
112 }
113
114 $db_update = new class($db, $client_ini) extends ilDBUpdate {
115 public function loadXMLInfo()
116 {
117 }
118 };
119
120 $db_update->applyUpdate();
121 $db_update->applyHotfix();
122 $db_update->applyCustomUpdates();
123
124 return $environment;
125 }
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
error($a_errmsg)
set error message @access public
Database Update class.
applyUpdate($a_break=0)
Apply update.
global $DIC
Definition: goto.php:24
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
$ini
Definition: raiseError.php:4
info()
Definition: info.php:2
$client_id
Definition: webdav.php:17

References $client_id, $DIC, $GLOBALS, $ini, ILIAS\GlobalScreen\Provider\__construct(), ilDBUpdate\applyUpdate(), error(), ILIAS\Setup\Environment\getResource(), and info().

+ Here is the call graph for this function:

◆ getHash()

ilDatabaseUpdatedObjective::getHash ( )

Definition at line 10 of file class.ilDatabaseUpdatedObjective.php.

10 : string
11 {
12 return hash("sha256", self::class);
13 }

◆ getLabel()

ilDatabaseUpdatedObjective::getLabel ( )

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

15 : string
16 {
17 return "The database is updated.";
18 }

◆ getPreconditions()

ilDatabaseUpdatedObjective::getPreconditions ( Setup\Environment  $environment)

Definition at line 25 of file class.ilDatabaseUpdatedObjective.php.

25 : array
26 {
27 return [
28 new Setup\Objective\ClientIdReadObjective(),
30 new \ilDatabaseInitializedObjective()
31 ];
32 }

◆ isApplicable()

ilDatabaseUpdatedObjective::isApplicable ( Setup\Environment  $environment)

@inheritDoc

Definition at line 130 of file class.ilDatabaseUpdatedObjective.php.

130 : bool
131 {
132 return true;
133 }

◆ isNotable()

ilDatabaseUpdatedObjective::isNotable ( )

Definition at line 20 of file class.ilDatabaseUpdatedObjective.php.

20 : bool
21 {
22 return true;
23 }

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