ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 {
91 return array(
92 // Main
95 // Experimental
99 );
100 }
101
102
107 public static function getAvailableTypes($with_descriptions = true)
108 {
109 $types = self::getSupportedTypes();
110 if ($with_descriptions) {
111 $return = array();
112 foreach ($types as $type) {
113 $return [$type] = self::describe($type);
114 }
115 $types = $return;
116 }
117
118 return $types;
119 }
120
121
125 public static function getSupportedTypes()
126 {
127 return array(
133 );
134 }
135
136
141 public static function describe($type)
142 {
143 return self::$descriptions[$type];
144 }
145}
An exception for terminatinating execution or to throw for unit testing.
Class ilDBConstants.
static describe($type)
static getAvailableTypes($with_descriptions=true)
static getInstallableTypes()
$type