ILIAS  release_8 Revision v8.25
class.ilCmiXapiDatabaseUpdateSteps.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
22{
23 protected ilDBInterface $db;
24
25 public function prepare(ilDBInterface $db): void
26 {
27 $this->db = $db;
28 }
29
30 public function step_1(): void
31 {
32 if (!$this->db->tableColumnExists('cmix_users', 'registration')) {
33 $this->db->addTableColumn('cmix_users', 'registration', array(
34 'type' => 'text',
35 'length' => 255,
36 'notnull' => true,
37 'default' => ''
38 ));
39 }
40 }
41
42 public function step_2(): void
43 {
44 if (!$this->db->tableColumnExists('cmix_settings', 'publisher_id')) {
45 $this->db->addTableColumn('cmix_settings', 'publisher_id', array(
46 'type' => 'text',
47 'length' => 255,
48 'notnull' => true,
49 'default' => ''
50 ));
51 }
52 }
53
54 public function step_3(): void
55 {
56 if (!$this->db->tableColumnExists('cmix_settings', 'anonymous_homepage')) {
57 $this->db->addTableColumn('cmix_settings', 'anonymous_homepage', array(
58 'type' => 'integer',
59 'length' => 1,
60 'notnull' => true,
61 'default' => 1
62 ));
63 }
64 }
65
66 public function step_4(): void
67 {
68 if (!$this->db->tableColumnExists('cmix_settings', 'moveon')) {
69 $this->db->addTableColumn('cmix_settings', 'moveon', array(
70 'type' => 'text',
71 'length' => 32,
72 'notnull' => true,
73 'default' => ''
74 ));
75 }
76 }
77
78 public function step_5(): void
79 {
80 if (!$this->db->tableColumnExists('cmix_token', 'cmi5_session')) {
81 $this->db->addTableColumn("cmix_token", "cmi5_session", [
82 'type' => 'text',
83 'length' => 255,
84 'notnull' => true,
85 'default' => ''
86 ]);
87 }
88 }
89
90 public function step_6(): void
91 {
92 if (!$this->db->tableColumnExists('cmix_token', 'returned_for_cmi5_session')) {
93 $this->db->addTableColumn("cmix_token", "returned_for_cmi5_session", [
94 'type' => 'text',
95 'length' => 255,
96 'notnull' => true,
97 'default' => ''
98 ]);
99 }
100 }
101
102 public function step_7(): void
103 {
104 if (!$this->db->tableColumnExists('cmix_settings', 'launch_parameters')) {
105 $this->db->addTableColumn('cmix_settings', 'launch_parameters', array(
106 'type' => 'text',
107 'length' => 255,
108 'notnull' => true,
109 'default' => ''
110 ));
111 }
112 }
113
114 public function step_8(): void
115 {
116 if (!$this->db->tableColumnExists('cmix_settings', 'entitlement_key')) {
117 $this->db->addTableColumn('cmix_settings', 'entitlement_key', array(
118 'type' => 'text',
119 'length' => 255,
120 'notnull' => true,
121 'default' => ''
122 ));
123 }
124 }
125
126 public function step_9(): void
127 {
128 if (!$this->db->tableColumnExists('cmix_token', 'cmi5_session_data')) {
129 $this->db->addTableColumn("cmix_token", "cmi5_session_data", [
130 'type' => 'clob'
131 ]);
132 }
133 }
134
135 public function step_10(): void
136 {
137 if (!$this->db->tableColumnExists('cmix_users', 'satisfied')) {
138 $this->db->addTableColumn('cmix_users', 'satisfied', array(
139 'type' => 'integer',
140 'length' => 1,
141 'notnull' => true,
142 'default' => 0
143 ));
144 }
145 }
146
147 public function step_11(): void
148 {
149 if (!$this->db->tableColumnExists('cmix_settings', 'switch_to_review')) {
150 $this->db->addTableColumn('cmix_settings', 'switch_to_review', array(
151 'type' => 'integer',
152 'length' => 1,
153 'notnull' => true,
154 'default' => 1
155 ));
156 }
157 }
158
159 public function step_12(): void
160 {
161 $this->db->manipulateF('DELETE FROM cmix_users WHERE usr_id = %s', ['integer'], [13]);
162 }
163}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Interface ilDBInterface.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...