ILIAS  release_7 Revision v7.30-3-g800a261c036
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.

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) {
41 break;
45 break;
49 break;
52 break;
53 default:
54 throw new ilDatabaseException("No viable database-type given: " . var_export($a_type, true));
55 }
56
57 return $ilDB;
58 }
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
Class ilDBPdoMySQLInnoDB.
Class ilDBPdoMySQLInnoDB.
Class ilDBPdoMySQLMyISAM.
Class ilDBPdoPostgreSQL.
Class ilDatabaseException.
INIFile Parser.
global $ilDB

References $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 DBSetup\__construct(), ilDatabaseCreatedObjective\achieve(), ilDatabaseExistsObjective\achieve(), ilDatabaseInitializedObjective\achieve(), ilDatabaseServerIsConnectableObjective\achieve(), ilSoapAdministration\getClientInfo(), ilInitialisation\initDatabase(), ilDatabaseCreatedObjective\isApplicable(), ilDatabaseAtomBaseTest\setUp(), and ilDatabaseAtomRunTest\setUp().

+ Here is the caller graph for this function:

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