ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilCtrlDatabaseUpdateSteps.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 /* Copyright (c) 2021 Thibeau Fuhrer <thf@studer-raimann.ch> Extended GPL, see docs/LICENSE */
6 
14 {
18  private ?ilDBInterface $database = null;
19 
23  public function prepare(ilDBInterface $db): void
24  {
25  $this->database = $db;
26  }
27 
32  public function step_1(): void
33  {
34  $this->abortIfNotPrepared();
35  if ($this->database->tableExists('ctrl_calls')) {
36  $this->database->dropTable('ctrl_calls');
37  }
38  }
39 
44  public function step_2(): void
45  {
46  $this->abortIfNotPrepared();
47  if ($this->database->tableExists('ctrl_classfile')) {
48  $this->database->dropTable('ctrl_classfile');
49  }
50  }
51 
56  public function step_3(): void
57  {
58  $this->abortIfNotPrepared();
59  if ($this->database->tableExists('ctrl_structure')) {
60  $this->database->dropTable('ctrl_structure');
61  }
62  }
63 
68  public function step_4(): void
69  {
70  $this->abortIfNotPrepared();
71  if ($this->database->tableExists('il_request_token')) {
72  $this->database->dropTable('il_request_token');
73  }
74  }
75 
80  public function step_5(): void
81  {
82  $this->abortIfNotPrepared();
83  if ($this->database->tableExists('service_class')) {
84  $this->database->dropTable('service_class');
85  }
86  }
87 
92  public function step_6(): void
93  {
94  $this->abortIfNotPrepared();
95  if ($this->database->tableExists('module_class')) {
96  $this->database->dropTable('module_class');
97  }
98  }
99 
107  private function abortIfNotPrepared(): void
108  {
109  if (null === $this->database) {
110  throw new LogicException(self::class . "::prepare() must be called before db-update-steps execution.");
111  }
112  }
113 }
step_5()
Deletes the table &#39;service_class&#39; from the database, since information is now stored in an artifact...
step_6()
Deletes the table &#39;module_class&#39; from the database, since information is now stored in an artifact...
step_4()
Deletes the table &#39;il_request_token&#39; from the database, since tokens are now stored in the ILIAS sess...
step_1()
Deletes the table &#39;ctrl_calls&#39; from the database, as it is no longer needed.
step_2()
Deletes the table &#39;ctrl_classfile&#39; from the database, as it is no longer needed.
Class ilCtrlDatabaseUpdateSteps holds the database update- steps affecting ilCtrl tables...
abortIfNotPrepared()
Halts the execution of these update steps if no database was provided.
step_3()
Deletes the table &#39;ctrl_structure&#39; from the database, as it is no longer needed.