ILIAS
trunk Revision v12.0_alpha-1227-g7ff6d300864
◀ ilDoc Overview
ilDBWrapperFactory.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
21
use
ILIAS\Database\PDO\InnoDBDetails
;
22
use
ILIAS\Database\PDO\GaleraDetails
;
23
36
class
ilDBWrapperFactory
37
{
43
public
static
function
getWrapper
(
string
$a_type): \
ilDBPdoInterface
44
{
45
$ilDB
=
new
ilDBPdo
(match ($a_type) {
46
'pdo-mysql-innodb'
,
ilDBConstants::TYPE_INNODB
=>
new
InnoDBDetails
(),
47
ilDBConstants::TYPE_GALERA
=>
new
GaleraDetails
(),
48
default
=>
throw
new
ilDatabaseException
(
"No viable database-type given: "
. var_export($a_type,
true
)),
49
});
50
51
return
$ilDB
;
52
}
53
}
ILIAS\Database\PDO\GaleraDetails
Definition:
GaleraDetails.php:28
ILIAS\Database\PDO\InnoDBDetails
Definition:
InnoDBDetails.php:42
ilDBConstants\TYPE_INNODB
const TYPE_INNODB
Definition:
ilDBConstants.php:34
ilDBConstants\TYPE_GALERA
const TYPE_GALERA
Definition:
ilDBConstants.php:37
ilDBPdo
Definition:
ilDBPdo.php:32
ilDBWrapperFactory
Class ilDBWrapperFactory.
Definition:
ilDBWrapperFactory.php:37
ilDBWrapperFactory\getWrapper
static getWrapper(string $a_type)
Definition:
ilDBWrapperFactory.php:43
ilDatabaseException
Class ilDatabaseException.
Definition:
exception.ilDatabaseException.php:28
ilDBPdoInterface
Interface ilDBPdoInterface.
Definition:
ilDBPdoInterface.php:25
$ilDB
$ilDB
Definition:
storeScorm2004.php:30
components
ILIAS
Database
classes
ilDBWrapperFactory.php
Generated on Wed Apr 8 2026 23:04:41 for ILIAS by
1.9.4 (using
Doxyfile
)