ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
ilDBWrapperFactory Class Reference

Class ilDBWrapperFactory. More...

+ Collaboration diagram for ilDBWrapperFactory:

Static Public Member Functions

static getWrapper ($a_type)
 

Detailed Description

Class ilDBWrapperFactory.

DB Wrapper Factory. Delivers a DB wrapper object depending on given DB type and DSN.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Fabian Schmid fs@st.nosp@m.uder.nosp@m.-raim.nosp@m.ann..nosp@m.ch

Definition at line 16 of file class.ilDBWrapperFactory.php.

Member Function Documentation

◆ getWrapper()

static ilDBWrapperFactory::getWrapper (   $a_type)
static
Parameters
$a_type
Returns
ilDBInterface
Exceptions
ilDatabaseException

Definition at line 25 of file class.ilDBWrapperFactory.php.

References $a_type, $GLOBALS, $ilDB, ilDBConstants\TYPE_GALERA, ilDBConstants\TYPE_INNODB, ilDBConstants\TYPE_MYSQL, ilDBConstants\TYPE_PDO_MYSQL_INNODB, ilDBConstants\TYPE_PDO_MYSQL_MYISAM, ilDBConstants\TYPE_PDO_POSTGRE, and ilDBConstants\TYPE_POSTGRES.

Referenced by ilDbSetup\__construct(), DBSetup\__construct(), ilDatabaseCreatedObjective\achieve(), ilDatabaseServerIsConnectableObjective\achieve(), ilDatabaseExistsObjective\achieve(), ilClient\connect(), ilSoapAdministration\getClientInfo(), ilInitialisation\initDatabase(), ilDatabaseAtomBaseTest\setUp(), and ilDatabaseAtomRunTest\setUp().

26  {
27  if ($a_type == "") {
28  if (isset($GLOBALS["DIC"])
29  && $GLOBALS["DIC"]->offsetExists("ilClientIniFile")
30  && $GLOBALS["DIC"]["ilClientIniFile"] instanceof \ilIniFile) {
31  $a_type = $GLOBALS["DIC"]["ilClientIniFile"]->readVariable("db", "type");
32  } else {
34  }
35  }
36 
37  switch ($a_type) {
40  $ilDB = new ilDBPdoPostgreSQL();
41  break;
44  $ilDB = new ilDBPdoMySQLInnoDB();
45  break;
48  $ilDB = new ilDBPdoMySQLMyISAM();
49  break;
51  $ilDB = new ilDBPdoMySQLGalera();
52  break;
53  default:
54  throw new ilDatabaseException("No viable database-type given: " . var_export($a_type, true));
55  }
56 
57  return $ilDB;
58  }
Class ilDBPdoPostgreSQL.
Class ilDBPdoMySQLMyISAM.
Class ilDatabaseException.
$a_type
Definition: workflow.php:92
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
global $ilDB
Class ilDBPdoMySQLInnoDB.
INIFile Parser.
Class ilDBPdoMySQLInnoDB.
+ Here is the caller graph for this function:

The documentation for this class was generated from the following file: