ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilDBConstants.php
Go to the documentation of this file.
1 <?php
2 
9 {
10  const FETCHMODE_ASSOC = 2;
11  const FETCHMODE_OBJECT = 3;
12  const FETCHMODE_DEFAULT = self::FETCHMODE_ASSOC;
13  // Main Types
14  const TYPE_INNODB = 'innodb';
15  const TYPE_MYSQL = 'mysql';
16  // Experimental
17  const TYPE_GALERA = 'galera';
18  const TYPE_POSTGRES = 'postgres';
19  const TYPE_MYSQLI = 'mysqli';
20  // Development identifiers (will be removed in 5.3), are mapped with Main and Experimental types
21  const TYPE_PDO_MYSQL_INNODB = 'pdo-mysql-innodb';
22  const TYPE_PDO_MYSQL_MYISAM = 'pdo-mysql-myisam';
23  const TYPE_PDO_MYSQL_GALERA = 'pdo-mysql-galera';
24  const TYPE_PDO_POSTGRE = 'pdo-postgre';
25  // Locks
28  // Modules
29  const MODULE_MANAGER = 'Manager';
30  const MODULE_REVERSE = 'Reverse';
31  // Formats
35  // Types
45  // Engines
46  const MYSQL_ENGINE_INNODB = 'InnoDB';
47  const MYSQL_ENGINE_MYISAM = 'MyISAM';
48  // Characters
49  const MYSQL_CHARACTER_UTF8 = 'utf8';
50  const MYSQL_CHARACTER_UTF8MB4 = 'utf8mb4';
51  // Collations
52  const MYSQL_COLLATION_UTF8 = 'utf8_general_ci';
53  const MYSQL_COLLATION_UTF8MB4 = 'utf8mb4_general_ci';
54  const MYSQL_COLLATION_UTF8_CZECH = "utf8_czech_ci";
55  const MYSQL_COLLATION_UTF8_DANISH = "utf8_danish_ci";
56  const MYSQL_COLLATION_UTF8_ESTONIAN = "utf8_estonian_ci";
57  const MYSQL_COLLATION_UTF8_ICELANDIC = "utf8_icelandic_ci";
58  const MYSQL_COLLATION_UTF8_LATVIAN = "utf8_latvian_ci";
59  const MYSQL_COLLATION_UTF8_LITHUANIAN = "utf8_lithuanian_ci";
60  const MYSQL_COLLATION_UTF8_PERSIAN = "utf8_persian_ci";
61  const MYSQL_COLLATION_UTF8_POLISH = "utf8_polish_ci";
62  const MYSQL_COLLATION_UTF8_ROMAN = "utf8_roman_ci";
63  const MYSQL_COLLATION_UTF8_ROMANIAN = "utf8_romanian_ci";
64  const MYSQL_COLLATION_UTF8_SLOVAK = "utf8_slovak_ci";
65  const MYSQL_COLLATION_UTF8_SLOVENIAN = "utf8_slovenian_ci";
66  const MYSQL_COLLATION_UTF8_SPANISH2 = "utf8_spanish2_ci";
67  const MYSQL_COLLATION_UTF8_SPANISH = "utf8_spanish_ci";
68  const MYSQL_COLLATION_UTF8_SWEDISH = "utf8_swedish_ci";
69  const MYSQL_COLLATION_UTF8_TURKISH = "utf8_turkish_ci";
70 
71  // Mapping AutoExec
72  const AUTOQUERY_INSERT = 1;
73  const AUTOQUERY_UPDATE = 2;
74  const AUTOQUERY_DELETE = 3;
75  const AUTOQUERY_SELECT = 4;
76  const PREPARE_MANIP = false;
77  // Other
78  const MB4_REPLACEMENT = "?";
82  protected static $descriptions = array(
83  // Main
84  ilDBConstants::TYPE_MYSQL => "MySQL 5.5.x or higher (MyISAM engine)",
85  ilDBConstants::TYPE_MYSQLI => "MySQL 5.5.x or higher (MyISAM engine)",
86  ilDBConstants::TYPE_INNODB => "MySQL 5.5.x or higher (InnoDB engine)",
87  // Experimental
88  ilDBConstants::TYPE_POSTGRES => "Postgres (experimental)",
89  ilDBConstants::TYPE_GALERA => "Galera-Cluster (experimental)",
90  // Development identifiers (will be removed in 5.3)
91  ilDBConstants::TYPE_PDO_MYSQL_MYISAM => "MySQL 5.5.x or higher (MyISAM engine) [developers-identifier]",
92  ilDBConstants::TYPE_PDO_MYSQL_INNODB => "MySQL 5.5.x or higher (InnoDB engine) [developers-identifier]",
93  ilDBConstants::TYPE_PDO_POSTGRE => "Postgres (experimental) [developers-identifier]",
94  ilDBConstants::TYPE_PDO_MYSQL_GALERA => "Galera-Cluster (experimental) [developers-identifier]",
95  );
96 
97 
101  public static function getInstallableTypes()
102  {
103  return array(
104  // Main
107  // Experimental
110  );
111  }
112 
113 
118  public static function getAvailableTypes($with_descriptions = true)
119  {
120  $types = self::getSupportedTypes();
121  if ($with_descriptions) {
122  $return = array();
123  foreach ($types as $type) {
124  $return [$type] = self::describe($type);
125  }
126  $types = $return;
127  }
128 
129  return $types;
130  }
131 
132 
136  public static function getSupportedTypes()
137  {
138  return array(
143  );
144  }
145 
149  public static function getAvailableCollations()
150  {
151  return [
170  ];
171  }
172 
173 
178  public static function describe($type)
179  {
180  return self::$descriptions[$type];
181  }
182 }
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
const MYSQL_COLLATION_UTF8_ESTONIAN
const MYSQL_COLLATION_UTF8_LATVIAN
const MYSQL_COLLATION_UTF8_PERSIAN
static describe($type)
const MYSQL_COLLATION_UTF8_SLOVENIAN
const MYSQL_COLLATION_UTF8_ROMAN
const MYSQL_COLLATION_UTF8_SLOVAK
static getAvailableTypes($with_descriptions=true)
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()