ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilDBConstants.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
27{
28 public const FETCHMODE_ASSOC = 2;
29 public const FETCHMODE_OBJECT = 3;
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 = [
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 [
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 = [];
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 [
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}
Class ilDBConstants.
const MYSQL_COLLATION_UTF8_SLOVAK
const MYSQL_COLLATION_UTF8_TURKISH
const MYSQL_COLLATION_UTF8_SPANISH2
static getAvailableCollations()
const MYSQL_COLLATION_UTF8_LATVIAN
static array $descriptions
const MYSQL_COLLATION_UTF8_ICELANDIC
const MYSQL_COLLATION_UTF8_CZECH
const MYSQL_COLLATION_UTF8_SLOVENIAN
const MYSQL_COLLATION_UTF8_ROMAN
const MYSQL_COLLATION_UTF8_PERSIAN
const MYSQL_COLLATION_UTF8_DANISH
static describe(string $type)
const MYSQL_COLLATION_UTF8_ROMANIAN
const MYSQL_COLLATION_UTF8_LITHUANIAN
const MYSQL_COLLATION_UTF8_POLISH
static getAvailableTypes(bool $with_descriptions=true)
const MYSQL_COLLATION_UTF8_ESTONIAN
const MYSQL_COLLATION_UTF8_SWEDISH
static getInstallableTypes()
const MYSQL_COLLATION_UTF8_SPANISH