ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables Modules Pages
ILIAS\Setup\ilMysqlMyIsamToInnoDbMigration Class Reference
+ Inheritance diagram for ILIAS\Setup\ilMysqlMyIsamToInnoDbMigration:
+ Collaboration diagram for ILIAS\Setup\ilMysqlMyIsamToInnoDbMigration:

Public Member Functions

 getLabel ()
 
 getDefaultAmountOfStepsPerRun ()
 
 getPreconditions (Environment $environment)
 
 step (Environment $environment)
 
 getRemainingAmountOfSteps ()
 
- Public Member Functions inherited from ILIAS\Setup\Migration
 prepare (Environment $environment)
 Prepare the migration by means of some environment. More...
 

Protected Member Functions

 getNonInnoDBTables ()
 

Protected Attributes

string $db_name = null
 
ilDBInterface $database = null
 

Additional Inherited Members

- Data Fields inherited from ILIAS\Setup\Migration
const INFINITE = -1
 

Detailed Description

Definition at line 28 of file class.ilMysqlMyIsamToInnoDbMigration.php.

Member Function Documentation

◆ getDefaultAmountOfStepsPerRun()

ILIAS\Setup\ilMysqlMyIsamToInnoDbMigration::getDefaultAmountOfStepsPerRun ( )

Implements ILIAS\Setup\Migration.

Definition at line 44 of file class.ilMysqlMyIsamToInnoDbMigration.php.

44  : int
45  {
46  return 20;
47  }

◆ getLabel()

ILIAS\Setup\ilMysqlMyIsamToInnoDbMigration::getLabel ( )

Implements ILIAS\Setup\Migration.

Definition at line 36 of file class.ilMysqlMyIsamToInnoDbMigration.php.

36  : string
37  {
38  return "Migration to convert tables from MyISAM to Innodb service";
39  }

◆ getNonInnoDBTables()

ILIAS\Setup\ilMysqlMyIsamToInnoDbMigration::getNonInnoDBTables ( )
protected

Definition at line 107 of file class.ilMysqlMyIsamToInnoDbMigration.php.

References ilDBConstants\MYSQL_ENGINE_INNODB.

Referenced by ILIAS\Setup\ilMysqlMyIsamToInnoDbMigration\getRemainingAmountOfSteps(), and ILIAS\Setup\ilMysqlMyIsamToInnoDbMigration\step().

107  : array
108  {
109  $tables = [];
110  $set = $this->database->queryF("SELECT table_name
111  FROM INFORMATION_SCHEMA.TABLES
112  WHERE ENGINE != %s AND table_schema = %s;", ['text', 'text'], [
114  $this->db_name
115  ]);
116  while ($row = $this->database->fetchAssoc($set)) {
117  $tables[] = $row['table_name'];
118  }
119  return $tables;
120  }
+ Here is the caller graph for this function:

◆ getPreconditions()

ILIAS\Setup\ilMysqlMyIsamToInnoDbMigration::getPreconditions ( Environment  $environment)

◆ getRemainingAmountOfSteps()

ILIAS\Setup\ilMysqlMyIsamToInnoDbMigration::getRemainingAmountOfSteps ( )

Implements ILIAS\Setup\Migration.

Definition at line 98 of file class.ilMysqlMyIsamToInnoDbMigration.php.

References $rows, and ILIAS\Setup\ilMysqlMyIsamToInnoDbMigration\getNonInnoDBTables().

98  : int
99  {
100  if ($this->db_name !== null) {
101  $rows = $this->getNonInnoDBTables();
102  return count($rows);
103  }
104  return 0;
105  }
$rows
Definition: xhr_table.php:10
+ Here is the call graph for this function:

◆ step()

ILIAS\Setup\ilMysqlMyIsamToInnoDbMigration::step ( Environment  $environment)

Exceptions
ilException

Implements ILIAS\Setup\Migration.

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

References Vendor\Package\$e, $rows, and ILIAS\Setup\ilMysqlMyIsamToInnoDbMigration\getNonInnoDBTables().

78  : void
79  {
80  $rows = $this->getNonInnoDBTables();
81  $table_name = array_pop($rows);
82 
83  if (is_string($table_name) && $table_name !== '') {
84  try {
85  $this->database->migrateTableToEngine($table_name);
86  } catch (\ilDatabaseException $e) {
87  throw new UnachievableException(
88  "The migration of the following tables did throw errors, " .
89  "please resolve the problem before you continue: \n" . $table_name . " -> " . $e->getMessage()
90  );
91  }
92  }
93  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$rows
Definition: xhr_table.php:10
+ Here is the call graph for this function:

Field Documentation

◆ $database

ilDBInterface ILIAS\Setup\ilMysqlMyIsamToInnoDbMigration::$database = null
protected

Definition at line 31 of file class.ilMysqlMyIsamToInnoDbMigration.php.

◆ $db_name

string ILIAS\Setup\ilMysqlMyIsamToInnoDbMigration::$db_name = null
protected

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


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