ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
class.ilObjectDBUpdateSteps.php
Go to the documentation of this file.
1 <?php
2 
19 namespace ILIAS\Object\Setup;
20 
25 {
26  protected \ilDBInterface $db;
27 
28  public function prepare(\ilDBInterface $db): void
29  {
30  $this->db = $db;
31  }
32 
33  public function step_1(): void
34  {
35  $field = [
36  "type" => \ilDBConstants::T_TEXT,
37  "length" => 255,
38  "notnull" => false
39  ];
40 
41  $this->db->modifyTableColumn("object_translation", "title", $field);
42  }
43 
44  public function step_2(): void
45  {
46  if ($this->db->tableExists("il_object_def")) {
47  $query = "UPDATE il_object_def SET " . PHP_EOL
48  . " component = REPLACE(component, 'Modules', 'components/ILIAS'), " . PHP_EOL
49  . " location = REPLACE(location, 'Modules', 'components/ILIAS')" . PHP_EOL
50  . " WHERE component LIKE ('Modules/%')";
51 
52  $this->db->manipulate($query);
53  }
54  }
55 
56  public function step_3(): void
57  {
58  $query = "UPDATE il_object_def SET " . PHP_EOL
59  . " component = REPLACE(component, 'Services', 'components/ILIAS'), " . PHP_EOL
60  . " location = REPLACE(location, 'Services', 'components/ILIAS')" . PHP_EOL
61  . " WHERE component LIKE ('Services/%')";
62 
63  $this->db->manipulate($query);
64  }
65 
66  public function step_4(): void
67  {
68  $query = "UPDATE il_object_def SET " . PHP_EOL
69  . " component = REPLACE(component, 'Language', 'Language_'), " . PHP_EOL
70  . " location = REPLACE(location, '/classes', '_/classes')" . PHP_EOL
71  . " WHERE component LIKE ('%Language')";
72 
73  $this->db->manipulate($query);
74  }
75 
76  public function step_5(): void
77  {
78  $query = "UPDATE il_object_def SET " . PHP_EOL
79  . " component = REPLACE(component, 'Language_', 'Language'), " . PHP_EOL
80  . " location = REPLACE(location, '_/classes', '/classes')" . PHP_EOL
81  . " WHERE component LIKE ('%Language')";
82 
83  $this->db->manipulate($query);
84  }
85 }
prepare(\ilDBInterface $db)
Prepare the execution of the steps.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...