ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilDBWrapperFactory.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
17 {
18 
25  public static function getWrapper($a_type)
26  {
27  global $DIC;
28  $ilClientIniFile = null;
29  if ($DIC != null && $DIC->offsetExists('ilClientIniFile')) {
33  $ilClientIniFile = $DIC['ilClientIniFile'];
34  }
35 
36  if ($a_type == "" && $ilClientIniFile instanceof ilIniFile) {
37  $a_type = $ilClientIniFile->readVariable("db", "type");
38  }
39  if ($a_type == "") {
41  }
42 
43  switch ($a_type) {
46  $ilDB = new ilDBPdoPostgreSQL();
47  break;
50  $ilDB = new ilDBPdoMySQLInnoDB();
51  break;
54  $ilDB = new ilDBPdoMySQLMyISAM();
55  break;
57  $ilDB = new ilDBPdoMySQLGalera();
58  break;
59  default:
60  throw new ilDatabaseException("No viable database-type given: " . var_export($a_type, true));
61  }
62 
63  return $ilDB;
64  }
65 }
Class ilDBPdoPostgreSQL.
global $DIC
Definition: saml.php:7
Class ilDBPdoMySQLMyISAM.
Class ilDatabaseException.
$a_type
Definition: workflow.php:92
global $ilDB
Class ilDBWrapperFactory.
Class ilDBPdoMySQLInnoDB.
INIFile Parser.
Class ilDBPdoMySQLInnoDB.