ILIAS  trunk Revision v11.0_alpha-1769-g99a433fe2dc
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator 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 27 of file class.ilMysqlMyIsamToInnoDbMigration.php.

Member Function Documentation

◆ getDefaultAmountOfStepsPerRun()

ILIAS\Setup\ilMysqlMyIsamToInnoDbMigration::getDefaultAmountOfStepsPerRun ( )

Implements ILIAS\Setup\Migration.

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

43  : int
44  {
45  return 20;
46  }

◆ getLabel()

ILIAS\Setup\ilMysqlMyIsamToInnoDbMigration::getLabel ( )

Implements ILIAS\Setup\Migration.

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

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

◆ getNonInnoDBTables()

ILIAS\Setup\ilMysqlMyIsamToInnoDbMigration::getNonInnoDBTables ( )
protected

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

References ilDBConstants\MYSQL_ENGINE_INNODB.

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

106  : array
107  {
108  $tables = [];
109  $set = $this->database->queryF("SELECT table_name
110  FROM INFORMATION_SCHEMA.TABLES
111  WHERE ENGINE != %s AND table_schema = %s;", ['text', 'text'], [
113  $this->db_name
114  ]);
115  while ($row = $this->database->fetchAssoc($set)) {
116  $tables[] = $row['table_name'];
117  }
118  return $tables;
119  }
+ 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 97 of file class.ilMysqlMyIsamToInnoDbMigration.php.

References ILIAS\Setup\ilMysqlMyIsamToInnoDbMigration\getNonInnoDBTables(), and null.

97  : int
98  {
99  if ($this->db_name !== null) {
100  $rows = $this->getNonInnoDBTables();
101  return count($rows);
102  }
103  return 0;
104  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:

◆ step()

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

Exceptions
ilException

Implements ILIAS\Setup\Migration.

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

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

77  : void
78  {
79  $rows = $this->getNonInnoDBTables();
80  $table_name = array_pop($rows);
81 
82  if (is_string($table_name) && $table_name !== '') {
83  try {
84  $this->database->migrateTableToEngine($table_name);
85  } catch (\ilDatabaseException $e) {
86  throw new UnachievableException(
87  "The migration of the following tables did throw errors, " .
88  "please resolve the problem before you continue: \n" . $table_name . " -> " . $e->getMessage()
89  );
90  }
91  }
92  }
+ Here is the call graph for this function:

Field Documentation

◆ $database

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

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

◆ $db_name

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

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


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