19declare(strict_types=1);
29 return hash(
"sha256", self::class);
34 return "The database object is initialized.";
64 if ($environment->
getResource(Environment::RESOURCE_DATABASE)) {
68 $client_ini = $environment->
getResource(Environment::RESOURCE_CLIENT_INI);
70 $type = $client_ini->readVariable(
"db",
"type");
76 $db->initFromIniFile($client_ini);
77 $connect = $db->connect(
true);
80 "Database cannot be connected."
84 return $environment->
withResource(Environment::RESOURCE_DATABASE, $db);
92 return $environment->
getResource(Environment::RESOURCE_CLIENT_INI) !==
null;
Signals that some goal won't be achievable by actions of the system ever.
static getWrapper(string $a_type)
getPreconditions(Environment $environment)
isNotable()
Get to know if this is an interesting objective for a human.
getHash()
Get a hash for this objective.
achieve(Environment $environment)
Objectives can be achieved.
getLabel()
Get a label that describes this objective.
isApplicable(Environment $environment)
@inheritDoc
An environment holds resources to be used in the setup process.
hasConfigFor(string $component)
getConfigFor(string $component)
getResource(string $id)
Consumers of this method should check if the result is what they expect, e.g.
withResource(string $id, $resource)
An objective is a desired state of the system that is supposed to be created by the setup.