19 declare(strict_types=1);
38 return hash(
"sha256", self::class);
43 return "The database server has valid settings.";
65 $db = $environment->
getResource(Environment::RESOURCE_DATABASE);
66 $io = $environment->
getResource(Environment::RESOURCE_ADMIN_INTERACTION);
69 $io->inform(
"Default Row Format is " . self::ROW_FORMAT_DYNAMIC .
".");
71 $io->inform(
"Default Engine is InnoDB.");
78 $default_engine =
'unknown';
80 $r = $db->
query(
'SHOW ENGINES ');
82 if (strtoupper((
string)
$d->Support) ===
'DEFAULT') {
83 $default_engine = strtolower((
string)
$d->Engine);
89 $default_engine = strtolower($default_engine);
91 if ($default_engine !== strtolower(self::INNO_DB)) {
93 "The default database engine is not set to '" . self::INNO_DB
94 .
", `$default_engine` given'. Please set the default database engine to '" 95 . self::INNO_DB .
" to proceed'." 102 $setting = $db->
fetchObject($db->
query(
'SELECT @@GLOBAL.innodb_default_row_format AS row_format;'));
103 $row_format = $setting->row_format ??
null;
104 if ($row_format ===
null || strtoupper((
string) $row_format) !== self::ROW_FORMAT_DYNAMIC) {
106 "The default row format of the database is not set to '" . self::ROW_FORMAT_DYNAMIC .
"'. Please set the default row format to " . self::ROW_FORMAT_DYNAMIC .
" and run an 'OPTIMIZE TABLE' for each of your database tables before you continue." 119 "Database cannot be connected. Please check the credentials." checkDefaultEngine(ilDBInterface $db)
An objective is a desired state of the system that is supposed to be created by the setup...
isNotable()
Get to know if this is an interesting objective for a human.
getLabel()
Get a label that describes this objective.
checkRowFormat(ilDBInterface $db)
getPreconditions(Environment $environment)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
Signals that some goal won't be achievable by actions of the system ever.
fetchObject(ilDBStatement $query_result)
query(string $query)
Run a (read-only) Query on the database.
getResource(string $id)
Consumers of this method should check if the result is what they expect, e.g.
isApplicable(Environment $environment)
achieve(Environment $environment)
Objectives can be achieved.
An environment holds resources to be used in the setup process.
getHash()
Get a hash for this objective.
checkDBAvailable(?ilDBInterface $db)