ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilDBWrapperFactory Class Reference

DB Wrapper Factory. More...

+ Collaboration diagram for ilDBWrapperFactory:

Static Public Member Functions

static getWrapper ($a_type, $a_inactive_mysqli=null)

Detailed Description

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
Version
Id:
class.ilDB.php 18989 2009-02-15 12:57:19Z akill

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

Member Function Documentation

static ilDBWrapperFactory::getWrapper (   $a_type,
  $a_inactive_mysqli = null 
)
static

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

References $ilDB.

Referenced by ilSoapAuthenticationCAS\__buildAuth(), ilBaseAuthentication\__buildDSN(), ilClient\connect(), ilSoapAdministration\getClientInfo(), and ilInitialisation\initDatabase().

{
global $ilClientIniFile;
if ($a_type == "" && is_object($ilClientIniFile))
{
$a_type = $ilClientIniFile->readVariable("db","type");
}
if ($a_type == "")
{
$a_type = "mysql";
}
switch ($a_type)
{
case "mysql":
include_once("./Services/Database/classes/class.ilDBMySQL.php");
$ilDB = new ilDBMySQL();
if($a_inactive_mysqli === null &&
is_object($ilClientIniFile))
{
$a_inactive_mysqli = $ilClientIniFile->readVariable("db","inactive_mysqli");
}
// default: use mysqli driver if not prevented by ini setting
if(!(bool)$a_inactive_mysqli)
{
$ilDB->setSubType("mysqli");
}
break;
case "innodb":
include_once("./Services/Database/classes/class.ilDBInnoDB.php");
$ilDB = new ilDBInnoDB();
if($a_inactive_mysqli === null &&
is_object($ilClientIniFile))
{
$a_inactive_mysqli = $ilClientIniFile->readVariable("db","inactive_mysqli");
}
// default: use mysqli driver if not prevented by ini setting
if(!(bool)$a_inactive_mysqli)
{
$ilDB->setSubType("mysqli");
}
break;
case "postgres":
include_once("./Services/Database/classes/class.ilDBPostgreSQL.php");
break;
case "oracle":
include_once("./Services/Database/classes/class.ilDBOracle.php");
$ilDB = new ilDBOracle();
break;
}
return $ilDB;
}

+ Here is the caller graph for this function:


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