19 declare(strict_types=1);
27 return hash(
"sha256", self::class);
32 return "The database object is initialized.";
47 if (!$environment->hasConfigFor(
"database")) {
53 $config = $environment->getConfigFor(
"database");
62 if ($environment->getResource(Setup\Environment::RESOURCE_DATABASE)) {
66 $client_ini = $environment->
getResource(Setup\Environment::RESOURCE_CLIENT_INI);
68 $type = $client_ini->readVariable(
"db",
"type");
74 $db->initFromIniFile($client_ini);
75 $connect = $db->connect(
true);
77 throw new Setup\UnachievableException(
78 "Database cannot be connected." 82 return $environment->withResource(Setup\Environment::RESOURCE_DATABASE, $db);
90 return $environment->getResource(Setup\Environment::RESOURCE_CLIENT_INI) !== null;
static getWrapper(string $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.