ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
AbandonLoadDependantSessionDatabaseUpdateObjective.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
24 use ilDBInterface;
25 
27 {
28  protected ilDBInterface $db;
29 
30  public function prepare(ilDBInterface $db): void
31  {
32  $this->db = $db;
33  }
34 
35  public function step_1(): void
36  {
37  $this->db->manipulate(
38  'DELETE FROM settings WHERE ' . $this->db->in(
39  'keyword',
40  [
41  'session_handling_type',
42  'session_max_count',
43  'session_min_idle',
44  'session_max_idle',
45  'session_max_idle_after_first_request'
46  ],
47  false,
49  )
50  );
51 
52  if ($this->db->tableExists('usr_session_log')) {
53  $this->db->dropTable('usr_session_log', false);
54  }
55 
56  if ($this->db->tableColumnExists('usr_session_stats', 'max_sessions')) {
57  $this->db->dropTableColumn('usr_session_stats', 'max_sessions');
58  }
59 
60  if ($this->db->tableColumnExists('usr_session_stats', 'closed_limit')) {
61  $this->db->dropTableColumn('usr_session_stats', 'closed_limit');
62  }
63 
64  if ($this->db->tableColumnExists('usr_session_stats', 'closed_idle')) {
65  $this->db->dropTableColumn('usr_session_stats', 'closed_idle');
66  }
67 
68  if ($this->db->tableColumnExists('usr_session_stats', 'closed_idle_first')) {
69  $this->db->dropTableColumn('usr_session_stats', 'closed_idle_first');
70  }
71  }
72 }