11 return hash(
"sha256", self::class);
16 return "The database object is initialized.";
28 if (!$environment->hasConfigFor(
"database")) {
34 $config = $environment->getConfigFor(
"database");
43 if ($environment->getResource(Setup\Environment::RESOURCE_DATABASE)) {
47 $client_ini = $environment->
getResource(Setup\Environment::RESOURCE_CLIENT_INI);
49 $type = $client_ini->readVariable(
"db",
"type");
55 $db->initFromIniFile($client_ini);
56 $connect = $db->connect(
true);
58 throw new Setup\UnachievableException(
59 "Database cannot be connected." 62 return $environment->withResource(Setup\Environment::RESOURCE_DATABASE, $db);
70 return $environment->getResource(Setup\Environment::RESOURCE_CLIENT_INI) !== null;
static getWrapper($a_type)
achieve(Setup\Environment $environment)
isApplicable(Setup\Environment $environment)
getPreconditions(Setup\Environment $environment)
getResource(string $id)
Consumers of this method should check if the result is what they expect, e.g.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
An environment holds resources to be used in the setup process.