ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 // Development identifiers (will be removed in 5.3), are mapped with Main and Experimental types
23 const TYPE_PDO_MYSQL_INNODB = 'pdo-mysql-innodb';
24 const TYPE_PDO_MYSQL_MYISAM = 'pdo-mysql-myisam';
25 const TYPE_PDO_MYSQL_GALERA = 'pdo-mysql-galera';
26 const TYPE_PDO_POSTGRE = 'pdo-postgre';
27 // Locks
30 // Modules
31 const MODULE_MANAGER = 'Manager';
32 const MODULE_REVERSE = 'Reverse';
33 // Formats
37 // Types
47 // Engines
48 const MYSQL_ENGINE_INNODB = 'InnoDB';
49 const MYSQL_ENGINE_MYISAM = 'MyISAM';
50 // Characters
51 const MYSQL_CHARACTER_UTF8 = 'utf8';
52 const MYSQL_CHARACTER_UTF8MB4 = 'utf8mb4';
53 // Collations
54 const MYSQL_COLLATION_UTF8 = 'utf8_general_ci';
55 const MYSQL_COLLATION_UTF8MB4 = 'utf8mb4_general_ci';
56 // Mapping AutoExec
61 const PREPARE_MANIP = false;
62 // Other
63 const MB4_REPLACEMENT = "?";
67 protected static $descriptions = array(
68 // Main
69 ilDBConstants::TYPE_MYSQL => "MySQL 5.5.x or higher (MyISAM engine)",
70 ilDBConstants::TYPE_MYSQLI => "MySQL 5.5.x or higher (MyISAM engine)",
71 ilDBConstants::TYPE_INNODB => "MySQL 5.5.x or higher (InnoDB engine)",
72 // Experimental
73 ilDBConstants::TYPE_POSTGRES => "Postgres (experimental)",
74 ilDBConstants::TYPE_GALERA => "Galera-Cluster (experimental)",
75 // Development identifiers (will be removed in 5.3)
76 ilDBConstants::TYPE_PDO_MYSQL_MYISAM => "MySQL 5.5.x or higher (MyISAM engine) [developers-identifier]",
77 ilDBConstants::TYPE_PDO_MYSQL_INNODB => "MySQL 5.5.x or higher (InnoDB engine) [developers-identifier]",
78 ilDBConstants::TYPE_PDO_POSTGRE => "Postgres (experimental) [developers-identifier]",
79 ilDBConstants::TYPE_PDO_MYSQL_GALERA => "Galera-Cluster (experimental) [developers-identifier]",
80 );
81
82
86 public static function getInstallableTypes()
87 {
88 return array(
89 // Main
92 // Experimental
95 );
96 }
97
98
103 public static function getAvailableTypes($with_descriptions = true)
104 {
105 $types = self::getSupportedTypes();
106 if ($with_descriptions) {
107 $return = array();
108 foreach ($types as $type) {
109 $return [$type] = self::describe($type);
110 }
111 $types = $return;
112 }
113
114 return $types;
115 }
116
117
121 public static function getSupportedTypes()
122 {
123 return array(
128 );
129 }
130
131
136 public static function describe($type)
137 {
138 return self::$descriptions[$type];
139 }
140}
An exception for terminatinating execution or to throw for unit testing.
Class ilDBConstants.
static describe($type)
static getAvailableTypes($with_descriptions=true)
static getInstallableTypes()
$type