19 declare(strict_types=1);
30 return hash(
"sha256", self::class);
35 return "The database server has valid settings.";
51 public function achieve(Setup\
Environment $environment): Setup\Environment
57 $db = $environment->getResource(Setup\Environment::RESOURCE_DATABASE);
58 $io = $environment->getResource(Setup\Environment::RESOURCE_ADMIN_INTERACTION);
61 $io->inform(
"Default Row Format is " . self::ROW_FORMAT_DYNAMIC .
".");
63 $io->inform(
"Default Engine is InnoDB.");
70 $default_engine =
'unknown';
72 $r = $db->
query(
'SHOW ENGINES ');
74 if (strtoupper(
$d->Support) ===
'DEFAULT') {
75 $default_engine = strtolower(
$d->Engine);
81 $default_engine = strtolower($default_engine);
83 if ($default_engine !== strtolower(self::INNO_DB)) {
84 throw new Setup\UnachievableException(
85 "The default database engine is not set to '" . self::INNO_DB
86 .
", `$default_engine` given'. Please set the default database engine to '" 87 . self::INNO_DB .
" to proceed'." 94 $setting = $db->
fetchObject($db->
query(
'SELECT @@GLOBAL.innodb_default_row_format AS row_format;'));
95 $row_format = $setting->row_format ?? null;
96 if ($row_format === null || strtoupper($row_format) !== self::ROW_FORMAT_DYNAMIC) {
97 throw new Setup\UnachievableException(
98 "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." 110 throw new Setup\UnachievableException(
111 "Database cannot be connected. Please check the credentials." checkDefaultEngine(ilDBInterface $db)
getPreconditions(Setup\Environment $environment)
checkRowFormat(ilDBInterface $db)
fetchObject(ilDBStatement $query_result)
query(string $query)
Run a (read-only) Query on the database.
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.
isApplicable(Setup\Environment $environment)
checkDBAvailable(?ilDBInterface $db)
for($i=6; $i< 13; $i++) for($i=1; $i< 13; $i++) $d