ILIAS  trunk Revision v12.0_alpha-377-g3641b37b9db
ILIAS\Help\Setup\ilHelpDBUpdateSteps Class Reference
+ Inheritance diagram for ILIAS\Help\Setup\ilHelpDBUpdateSteps:
+ Collaboration diagram for ILIAS\Help\Setup\ilHelpDBUpdateSteps:

Public Member Functions

 prepare (\ilDBInterface $db)
 Prepare the execution of the steps. More...
 
 step_1 ()
 
 step_2 ()
 
 step_3 ()
 
 step_4 ()
 
 step_5 ()
 
 step_6 ()
 
 step_7 ()
 
 step_8 ()
 
 step_9 ()
 
 step_10 ()
 
 prepare (\ilDBInterface $db)
 Prepare the execution of the steps. More...
 

Protected Attributes

ilDBInterface $db
 

Detailed Description

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

Member Function Documentation

◆ prepare()

ILIAS\Help\Setup\ilHelpDBUpdateSteps::prepare ( \ilDBInterface  $db)

Prepare the execution of the steps.

Do not use anything from the globals or the DIC inside your steps, only use the instance of the database provided here.

Implements ilDatabaseUpdateSteps.

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

25 : void
26 {
27 $this->db = $db;
28 }

References ILIAS\Help\Setup\ilHelpDBUpdateSteps\$db.

◆ step_1()

ILIAS\Help\Setup\ilHelpDBUpdateSteps::step_1 ( )

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

30 : void
31 {
32 if (!$this->db->tableColumnExists('help_module', 'order_nr')) {
33 $this->db->addTableColumn('help_module', 'order_nr', array(
34 'type' => 'integer',
35 'notnull' => true,
36 'length' => 4,
37 'default' => 0
38 ));
39 }
40 }

◆ step_10()

ILIAS\Help\Setup\ilHelpDBUpdateSteps::step_10 ( )

Definition at line 233 of file class.ilHelpDBUpdateSteps.php.

233 : void
234 {
235 if ($this->db->primaryExistsByFields('help_map', array(
236 'chap', 'component', 'screen_id', 'screen_sub_id', 'perm', 'module_id'))) {
237 $this->db->dropPrimaryKey('help_map');
238 }
239 }

◆ step_2()

ILIAS\Help\Setup\ilHelpDBUpdateSteps::step_2 ( )

Definition at line 42 of file class.ilHelpDBUpdateSteps.php.

42 : void
43 {
44 if (!$this->db->tableColumnExists('help_module', 'active')) {
45 $this->db->addTableColumn('help_module', 'active', array(
46 'type' => 'integer',
47 'notnull' => true,
48 'length' => 1,
49 'default' => 0
50 ));
51 }
52 }

◆ step_3()

ILIAS\Help\Setup\ilHelpDBUpdateSteps::step_3 ( )

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

54 : void
55 {
56 $set = $this->db->queryF(
57 "SELECT value FROM settings " .
58 " WHERE module = %s AND keyword = %s",
59 ["text", "text"],
60 ["common", "help_module"]
61 );
62 if ($rec = $this->db->fetchAssoc($set)) {
63 $id = (int) $rec["value"];
64 if ($id > 0) {
65 $this->db->update(
66 "help_module",
67 [
68 "active" => ["integer", 1]
69 ],
70 [ // where
71 "id" => ["integer", $id]
72 ]
73 );
74 }
75 }
76 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23

References $id, and ILIAS\Repository\int().

+ Here is the call graph for this function:

◆ step_4()

ILIAS\Help\Setup\ilHelpDBUpdateSteps::step_4 ( )

Definition at line 78 of file class.ilHelpDBUpdateSteps.php.

78 : void
79 {
80 if (!$this->db->tableColumnExists('help_map', 'full_id')) {
81 $this->db->addTableColumn('help_map', 'full_id', array(
82 'type' => 'text',
83 'length' => 1000,
84 'default' => ""
85 ));
86 }
87 }

◆ step_5()

ILIAS\Help\Setup\ilHelpDBUpdateSteps::step_5 ( )

Definition at line 89 of file class.ilHelpDBUpdateSteps.php.

89 : void
90 {
91 if (!$this->db->tableExists('help_gt_settings')) {
92 $this->db->createTable(
93 'help_gt_settings',
94 [
95 'obj_id' => [
96 'type' => 'integer',
97 'length' => 4,
98 'notnull' => true
99 ],
100 'active' => [
101 'type' => 'integer',
102 'length' => 1,
103 'notnull' => true,
104 'default' => 0
105 ],
106 'screen_ids' => [
107 'type' => 'text',
108 'length' => 1000,
109 'notnull' => true,
110 'default' => ''
111 ],
112 'permission' => [
113 'type' => 'integer',
114 'length' => 1,
115 'notnull' => true,
116 'default' => 0
117 ],
118 ]
119 );
120 $this->db->addPrimaryKey('help_gt_settings', ['obj_id']);
121 }
122 }

◆ step_6()

ILIAS\Help\Setup\ilHelpDBUpdateSteps::step_6 ( )

Definition at line 124 of file class.ilHelpDBUpdateSteps.php.

124 : void
125 {
126 if (!$this->db->tableExists('help_gt_step')) {
127 $this->db->createTable(
128 'help_gt_step',
129 [
130 'id' => [
131 'type' => 'integer',
132 'length' => 4,
133 'notnull' => true
134 ],
135 'tour_id' => [
136 'type' => 'integer',
137 'length' => 4,
138 'notnull' => true
139 ],
140 'order_nr' => [
141 'type' => 'integer',
142 'length' => 4,
143 'notnull' => true
144 ],
145 'type' => [
146 'type' => 'integer',
147 'length' => 1,
148 'notnull' => true
149 ],
150 'element_id' => [
151 'type' => 'text',
152 'length' => 1000,
153 'notnull' => true,
154 'default' => ''
155 ]
156 ]
157 );
158 $this->db->addPrimaryKey('help_gt_step', ['id']);
159 }
160 }

◆ step_7()

ILIAS\Help\Setup\ilHelpDBUpdateSteps::step_7 ( )

Definition at line 162 of file class.ilHelpDBUpdateSteps.php.

162 : void
163 {
164 $this->db->createSequence('help_gt_step');
165 }

◆ step_8()

ILIAS\Help\Setup\ilHelpDBUpdateSteps::step_8 ( )

Definition at line 167 of file class.ilHelpDBUpdateSteps.php.

167 : void
168 {
169 if (!$this->db->tableExists('help_gt_user_finished')) {
170 $this->db->createTable(
171 'help_gt_user_finished',
172 [
173 'tour_id' => [
174 'type' => 'integer',
175 'length' => 4,
176 'notnull' => true
177 ],
178 'user_id' => [
179 'type' => 'integer',
180 'length' => 4,
181 'notnull' => true
182 ]
183 ]
184 );
185 $this->db->addPrimaryKey('help_gt_user_finished', ['tour_id', 'user_id']);
186 }
187 }

◆ step_9()

ILIAS\Help\Setup\ilHelpDBUpdateSteps::step_9 ( )

Definition at line 189 of file class.ilHelpDBUpdateSteps.php.

189 : void
190 {
191 // step 5 might not be run on ilias 10 systems (see 10 branch)
192 if (!$this->db->tableExists('help_gt_settings')) {
193 $this->db->createTable(
194 'help_gt_settings',
195 [
196 'obj_id' => [
197 'type' => 'integer',
198 'length' => 4,
199 'notnull' => true
200 ],
201 'active' => [
202 'type' => 'integer',
203 'length' => 1,
204 'notnull' => true,
205 'default' => 0
206 ],
207 'screen_ids' => [
208 'type' => 'text',
209 'length' => 1000,
210 'notnull' => true,
211 'default' => ''
212 ],
213 'permission' => [
214 'type' => 'integer',
215 'length' => 1,
216 'notnull' => true,
217 'default' => 0
218 ],
219 ]
220 );
221 $this->db->addPrimaryKey('help_gt_settings', ['obj_id']);
222 }
223 if (!$this->db->tableColumnExists('help_gt_settings', 'lang')) {
224 $this->db->addTableColumn('help_gt_settings', 'lang', array(
225 'type' => 'text',
226 'notnull' => true,
227 'length' => 10,
228 'default' => ''
229 ));
230 }
231 }

Field Documentation

◆ $db

ilDBInterface ILIAS\Help\Setup\ilHelpDBUpdateSteps::$db
protected

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