ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilDBConstants.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
27 {
28  public const FETCHMODE_ASSOC = 2;
29  public const FETCHMODE_OBJECT = 3;
30  public const FETCHMODE_DEFAULT = self::FETCHMODE_ASSOC;
31  // Main Types
32  public const TYPE_INNODB = 'innodb';
33  public const TYPE_MYSQL = 'mysql';
34  // Experimental
35  public const TYPE_GALERA = 'galera';
36  public const TYPE_MYSQLI = 'mysqli';
37  // Development identifiers (will be removed in 5.3), are mapped with Main and Experimental types
38  public const TYPE_PDO_MYSQL_INNODB = 'pdo-mysql-innodb';
39  public const TYPE_PDO_MYSQL_GALERA = 'pdo-mysql-galera';
40  // Locks
43  // Modules
44  public const MODULE_MANAGER = 'Manager';
45  public const MODULE_REVERSE = 'Reverse';
46  // Formats
50  // Types
60  // Engines
61  public const MYSQL_ENGINE_INNODB = 'InnoDB';
62  // Characters
63  public const MYSQL_CHARACTER_UTF8 = 'utf8';
64  public const MYSQL_CHARACTER_UTF8MB4 = 'utf8mb4';
65  // Collations
66  public const MYSQL_COLLATION_UTF8 = 'utf8_general_ci';
67  public const MYSQL_COLLATION_UTF8MB4 = 'utf8mb4_general_ci';
68  public const MYSQL_COLLATION_UTF8_CZECH = "utf8_czech_ci";
69  public const MYSQL_COLLATION_UTF8_DANISH = "utf8_danish_ci";
70  public const MYSQL_COLLATION_UTF8_ESTONIAN = "utf8_estonian_ci";
71  public const MYSQL_COLLATION_UTF8_ICELANDIC = "utf8_icelandic_ci";
72  public const MYSQL_COLLATION_UTF8_LATVIAN = "utf8_latvian_ci";
73  public const MYSQL_COLLATION_UTF8_LITHUANIAN = "utf8_lithuanian_ci";
74  public const MYSQL_COLLATION_UTF8_PERSIAN = "utf8_persian_ci";
75  public const MYSQL_COLLATION_UTF8_POLISH = "utf8_polish_ci";
76  public const MYSQL_COLLATION_UTF8_ROMAN = "utf8_roman_ci";
77  public const MYSQL_COLLATION_UTF8_ROMANIAN = "utf8_romanian_ci";
78  public const MYSQL_COLLATION_UTF8_SLOVAK = "utf8_slovak_ci";
79  public const MYSQL_COLLATION_UTF8_SLOVENIAN = "utf8_slovenian_ci";
80  public const MYSQL_COLLATION_UTF8_SPANISH2 = "utf8_spanish2_ci";
81  public const MYSQL_COLLATION_UTF8_SPANISH = "utf8_spanish_ci";
82  public const MYSQL_COLLATION_UTF8_SWEDISH = "utf8_swedish_ci";
83  public const MYSQL_COLLATION_UTF8_TURKISH = "utf8_turkish_ci";
84 
85  // Mapping AutoExec
86  public const AUTOQUERY_INSERT = 1;
87  public const AUTOQUERY_UPDATE = 2;
88  public const AUTOQUERY_DELETE = 3;
89  public const AUTOQUERY_SELECT = 4;
90  public const PREPARE_MANIP = false;
91  // Other
92  public const MB4_REPLACEMENT = "?";
96  protected static array $descriptions = array(
97  // Main
98  ilDBConstants::TYPE_MYSQL => "MySQL 5.7.x or higher with InnoDB-Engine",
99  ilDBConstants::TYPE_MYSQLI => "MySQL 5.7.x or higher with InnoDB-Engine",
100  ilDBConstants::TYPE_INNODB => "MySQL 5.7.x or higher with InnoDB-Engine",
101  ilDBConstants::TYPE_GALERA => "Galera-Cluster (experimental)",
102  // Development identifiers (will be removed in 5.3)
103  ilDBConstants::TYPE_PDO_MYSQL_GALERA => "Galera-Cluster (experimental) [developers-identifier]",
104  );
105 
106 
110  public static function getInstallableTypes(): array
111  {
112  return array(
113  // Main
116  // Experimental
119  );
120  }
121 
122  public static function getAvailableTypes(bool $with_descriptions = true): array
123  {
124  $types = self::getSupportedTypes();
125  if ($with_descriptions) {
126  $return = array();
127  foreach ($types as $type) {
128  $return [$type] = self::describe($type);
129  }
130  $types = $return;
131  }
132 
133  return $types;
134  }
135 
136 
137  public static function getSupportedTypes(): array
138  {
139  return array(
143  );
144  }
145 
149  public static function getAvailableCollations(): array
150  {
151  return [
170  ];
171  }
172 
173  public static function describe(string $type): string
174  {
175  return self::$descriptions[$type];
176  }
177 }
const MYSQL_COLLATION_UTF8_SWEDISH
const MYSQL_COLLATION_UTF8_POLISH
const MYSQL_COLLATION_UTF8_DANISH
const MYSQL_COLLATION_UTF8_TURKISH
$type
const MYSQL_COLLATION_UTF8_ICELANDIC
static array $descriptions
const MYSQL_COLLATION_UTF8_ESTONIAN
const MYSQL_COLLATION_UTF8_LATVIAN
const MYSQL_COLLATION_UTF8_PERSIAN
static describe(string $type)
const MYSQL_COLLATION_UTF8_SLOVENIAN
const MYSQL_COLLATION_UTF8_ROMAN
const MYSQL_COLLATION_UTF8_SLOVAK
const MYSQL_COLLATION_UTF8_SPANISH
static getAvailableCollations()
const MYSQL_COLLATION_UTF8_LITHUANIAN
const MYSQL_COLLATION_UTF8_ROMANIAN
const MYSQL_COLLATION_UTF8_SPANISH2
const MYSQL_COLLATION_UTF8_CZECH
static getInstallableTypes()
static getAvailableTypes(bool $with_descriptions=true)