ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
class.ilDBConstants.php
Go to the documentation of this file.
1<?php
2require_once('./Services/Database/classes/PDO/FieldDefinition/class.ilDBPdoFieldDefinition.php');
3require_once('./Services/Database/classes/Atom/class.ilAtomQueryBase.php');
4
11
12 const FETCHMODE_ASSOC = 2;
15 // Main Types
16 const TYPE_INNODB = 'innodb';
17 const TYPE_MYSQL = 'mysql';
18 // Experimental
19 const TYPE_GALERA = 'galera';
20 const TYPE_POSTGRES = 'postgres';
21 const TYPE_MYSQLI = 'mysqli';
22 // Oracle Legacy
23 const TYPE_ORACLE = 'oracle';
24 // Development identifiers (will be removed in 5.3), are mapped with Main and Experimental types
25 const TYPE_PDO_MYSQL_INNODB = 'pdo-mysql-innodb';
26 const TYPE_PDO_MYSQL_MYISAM = 'pdo-mysql-myisam';
27 const TYPE_PDO_MYSQL_GALERA = 'pdo-mysql-galera';
28 const TYPE_PDO_POSTGRE = 'pdo-postgre';
29 // Locks
32 // Modules
33 const MODULE_MANAGER = 'Manager';
34 const MODULE_REVERSE = 'Reverse';
35 // Formats
39 // Types
49 // Engines
50 const MYSQL_ENGINE_INNODB = 'InnoDB';
51 const MYSQL_ENGINE_MYISAM = 'MyISAM';
52 // Characters
53 const MYSQL_CHARACTER_UTF8 = 'utf8';
54 const MYSQL_CHARACTER_UTF8MB4 = 'utf8mb4';
55 // Collations
56 const MYSQL_COLLATION_UTF8 = 'utf8_general_ci';
57 const MYSQL_COLLATION_UTF8MB4 = 'utf8mb4_general_ci';
58 // Mapping AutoExec
63 const MDB2_PREPARE_MANIP = false;
64 // Other
65 const MB4_REPLACEMENT = "?";
69 protected static $descriptions = array(
70 // Main
71 ilDBConstants::TYPE_MYSQL => "MySQL 5.5.x or higher (MyISAM engine)",
72 ilDBConstants::TYPE_MYSQLI => "MySQL 5.5.x or higher (MyISAM engine)",
73 ilDBConstants::TYPE_INNODB => "MySQL 5.5.x or higher (InnoDB engine)",
74 // Experimental
75 ilDBConstants::TYPE_ORACLE => "Oracle 10g or higher (PHP 5.x only)",
76 ilDBConstants::TYPE_POSTGRES => "Postgres (experimental)",
77 ilDBConstants::TYPE_GALERA => "Galera-Cluster (experimental)",
78 // Development identifiers (will be removed in 5.3)
79 ilDBConstants::TYPE_PDO_MYSQL_MYISAM => "MySQL 5.5.x or higher (MyISAM engine) [developers-identifier]",
80 ilDBConstants::TYPE_PDO_MYSQL_INNODB => "MySQL 5.5.x or higher (InnoDB engine) [developers-identifier]",
81 ilDBConstants::TYPE_PDO_POSTGRE => "Postgres (experimental) [developers-identifier]",
82 ilDBConstants::TYPE_PDO_MYSQL_GALERA => "Galera-Cluster (experimental) [developers-identifier]",
83 );
84
85
89 public static function getInstallableTypes() {
90 return array(
91 // Main
94 // Experimental
98 );
99 }
100
101
106 public static function getAvailableTypes($with_descriptions = true) {
107 $types = self::getSupportedTypes();
108 if ($with_descriptions) {
109 $return = array();
110 foreach ($types as $type) {
111 $return [$type] = self::describe($type);
112 }
113 $types = $return;
114 }
115
116 return $types;
117 }
118
119
123 public static function getSupportedTypes() {
124 return array(
130 );
131 }
132
133
138 public static function describe($type) {
139 return self::$descriptions[$type];
140 }
141}
An exception for terminatinating execution or to throw for unit testing.
Class ilDBConstants.
static describe($type)
static getAvailableTypes($with_descriptions=true)
static getInstallableTypes()