ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
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 
4 
5 include_once ("./Services/Database/classes/class.ilDB.php");
6 
16 {
17  static function getWrapper($a_type)
18  {
19  global $ilClientIniFile;
20 
21  if ($a_type == "" && is_object($ilClientIniFile))
22  {
23  $a_type = $ilClientIniFile->readVariable("db","type");
24  }
25  if ($a_type == "")
26  {
27  $a_type = "mysql";
28  }
29 
30  switch ($a_type)
31  {
32  case "mysql":
33  include_once("./Services/Database/classes/class.ilDBMySQL.php");
34  $ilDB = new ilDBMySQL();
35  break;
36 
37  case "oracle":
38  include_once("./Services/Database/classes/class.ilDBOracle.php");
39  $ilDB = new ilDBOracle();
40  break;
41  }
42 
43  return $ilDB;
44  }
45 }