ILIAS
release_5-3 Revision v5.3.23-19-g915713cf615
◀ ilDoc Overview
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
require_once(
"./Services/Database/exceptions/exception.ilDatabaseException.php"
);
4
require_once(
'./Services/Database/classes/class.ilDBConstants.php'
);
5
require_once(
"./Services/Database/interfaces/interface.ilDBInterface.php"
);
6
require_once(
'./Services/Database/interfaces/interface.ilDBManager.php'
);
7
require_once(
'./Services/Database/interfaces/interface.ilDBReverse.php'
);
8
21
class
ilDBWrapperFactory
22
{
23
30
public
static
function
getWrapper(
$a_type
, $a_inactive_mysqli = null)
31
{
32
global $ilClientIniFile;
37
if
(
$a_type
==
""
&& is_object($ilClientIniFile)) {
38
$a_type
= $ilClientIniFile->readVariable(
"db"
,
"type"
);
39
}
40
if
(
$a_type
==
""
) {
41
$a_type
=
ilDBConstants::TYPE_PDO_MYSQL_MYISAM
;
42
}
43
44
// For legacy code
45
if
(!
defined
(
'DB_FETCHMODE_ASSOC'
)) {
46
define(
"DB_FETCHMODE_ASSOC"
,
ilDBConstants::FETCHMODE_ASSOC
);
47
}
48
if
(!
defined
(
'DB_FETCHMODE_OBJECT'
)) {
49
define(
"DB_FETCHMODE_OBJECT"
,
ilDBConstants::FETCHMODE_OBJECT
);
50
}
51
52
switch
(
$a_type
) {
53
case
ilDBConstants::TYPE_POSTGRES
:
54
case
ilDBConstants::TYPE_PDO_POSTGRE
:
55
require_once(
'./Services/Database/classes/PDO/class.ilDBPdoPostgreSQL.php'
);
56
$ilDB
=
new
ilDBPdoPostgreSQL
();
57
break
;
58
case
ilDBConstants::TYPE_ORACLE
:
59
include_once(
"./Services/Database/classes/MDB2/class.ilDBOracle.php"
);
60
$ilDB
=
new
ilDBOracle
();
61
break
;
62
case
ilDBConstants::TYPE_PDO_MYSQL_INNODB
:
63
case
ilDBConstants::TYPE_INNODB
:
64
require_once(
'./Services/Database/classes/PDO/class.ilDBPdoMySQLInnoDB.php'
);
65
$ilDB
=
new
ilDBPdoMySQLInnoDB
();
66
break
;
67
case
ilDBConstants::TYPE_PDO_MYSQL_MYISAM
:
68
case
ilDBConstants::TYPE_MYSQL
:
69
require_once(
'./Services/Database/classes/PDO/class.ilDBPdoMySQLMyISAM.php'
);
70
$ilDB
=
new
ilDBPdoMySQLMyISAM
();
71
break
;
72
case
ilDBConstants::TYPE_GALERA
:
73
require_once(
'./Services/Database/classes/PDO/class.ilDBPdoMySQLGalera.php'
);
74
$ilDB
=
new
ilDBPdoMySQLGalera
();
75
break
;
76
case
'postgres-legacy'
:
77
require_once(
'./Services/Database/classes/MDB2/class.ilDBPostgreSQL.php'
);
78
$ilDB
=
new
ilDBPostgreSQL
();
79
break
;
80
case
'mysql-legacy'
:
81
require_once(
'./Services/Database/classes/MDB2/class.ilDBMySQL.php'
);
82
$ilDB
=
new
ilDBMySQL
();
83
break
;
84
case
'innodb-legacy'
:
85
require_once(
'./Services/Database/classes/MDB2/class.ilDBInnoDB.php'
);
86
$ilDB
=
new
ilDBInnoDB
();
87
break
;
88
default
:
89
throw
new
ilDatabaseException
(
"No viable database-type given: "
. var_export(
$a_type
,
true
));
90
}
91
92
return
$ilDB
;
93
}
94
}
ilDBPostgreSQL
PostreSQL Database Wrapper.
Definition:
class.ilDBPostgreSQL.php:18
ilDBPdoPostgreSQL
Class ilDBPdoPostgreSQL.
Definition:
class.ilDBPdoPostgreSQL.php:13
ilDBInnoDB
MySQL InnoDB Database Wrapper.
Definition:
class.ilDBInnoDB.php:18
ilDBPdoMySQLMyISAM
Class ilDBPdoMySQLMyISAM.
Definition:
class.ilDBPdoMySQLMyISAM.php:11
ilDBConstants\TYPE_GALERA
const TYPE_GALERA
Definition:
class.ilDBConstants.php:19
ilDatabaseException
Class ilDatabaseException.
Definition:
exception.ilDatabaseException.php:11
ilDBConstants\TYPE_PDO_POSTGRE
const TYPE_PDO_POSTGRE
Definition:
class.ilDBConstants.php:28
ilDBConstants\TYPE_PDO_MYSQL_INNODB
const TYPE_PDO_MYSQL_INNODB
Definition:
class.ilDBConstants.php:25
ilDBConstants\TYPE_PDO_MYSQL_MYISAM
const TYPE_PDO_MYSQL_MYISAM
Definition:
class.ilDBConstants.php:26
ilDBConstants\TYPE_ORACLE
const TYPE_ORACLE
Definition:
class.ilDBConstants.php:23
$a_type
$a_type
Definition:
workflow.php:92
ilDBConstants\TYPE_INNODB
const TYPE_INNODB
Definition:
class.ilDBConstants.php:16
ilDBConstants\TYPE_MYSQL
const TYPE_MYSQL
Definition:
class.ilDBConstants.php:17
ilDBMySQL
MySQL Database Wrapper.
Definition:
class.ilDBMySQL.php:18
$ilDB
global $ilDB
Definition:
storeScorm2004.php:16
ilDBWrapperFactory
Class ilDBWrapperFactory.
Definition:
class.ilDBWrapperFactory.php:21
ilDBPdoMySQLInnoDB
Class ilDBPdoMySQLInnoDB.
Definition:
class.ilDBPdoMySQLInnoDB.php:11
ilDBConstants\FETCHMODE_ASSOC
const FETCHMODE_ASSOC
Definition:
class.ilDBConstants.php:12
ilDBConstants\FETCHMODE_OBJECT
const FETCHMODE_OBJECT
Definition:
class.ilDBConstants.php:13
ilDBConstants\TYPE_POSTGRES
const TYPE_POSTGRES
Definition:
class.ilDBConstants.php:20
defined
defined( 'APPLICATION_ENV')||define( 'APPLICATION_ENV'
Definition:
bootstrap.php:27
ilDBPdoMySQLGalera
Class ilDBPdoMySQLInnoDB.
Definition:
class.ilDBPdoMySQLGalera.php:11
ilDBOracle
Oracle Database Wrapper.
Definition:
class.ilDBOracle.php:18
Services
Database
classes
class.ilDBWrapperFactory.php
Generated on Tue Jan 28 2025 19:01:33 for ILIAS by
1.8.13 (using
Doxyfile
)