mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
Merge branch 'm36_MDL-51080_MAriaDB_Wrong_DB_Type' of https://github.com/scara/moodle
This commit is contained in:
commit
9d05da3f6d
@ -529,6 +529,7 @@ $string['environmentrequireversion'] = 'version {$a->needed} is required and you
|
||||
$string['environmentsettingok'] = 'recommended setting detected';
|
||||
$string['environmentshouldfixsetting'] = 'PHP setting should be changed.';
|
||||
$string['environmentxmlerror'] = 'Error reading environment data ({$a->error_code})';
|
||||
$string['environmentmariadbwrongdbtype'] = 'Wrong <code>$CFG->dbtype</code>: you need to change it in your <code>config.php</code> file, from \'<code>mysql</code>\' to \'<code>mariadb</code>\'.';
|
||||
$string['errordeletingconfig'] = 'An error occurred while deleting the configuration records for plugin \'{$a}\'.';
|
||||
$string['errorsetting'] = 'Could not save setting:';
|
||||
$string['errorwithsettings'] = 'Some settings were not changed due to an error.';
|
||||
|
@ -1048,6 +1048,19 @@ function environment_check_database($version, $env_select) {
|
||||
return $result;
|
||||
}
|
||||
|
||||
// Check if the DB Vendor has been properly configured.
|
||||
// Hack: this is required when playing with MySQL and MariaDB since they share the same PHP module and base DB classes,
|
||||
// whilst they are slowly evolving using separate directions though MariaDB is still an "almost" drop-in replacement.
|
||||
$dbvendorismysql = ($current_vendor === 'mysql');
|
||||
$dbtypeismariadb = (stripos($dbinfo['description'], 'mariadb') !== false);
|
||||
if ($dbvendorismysql && $dbtypeismariadb) {
|
||||
$result->setStatus(false);
|
||||
$result->setLevel($level);
|
||||
$result->setInfo($current_vendor . ' (' . $dbinfo['description'] . ')');
|
||||
$result->setFeedbackStr('environmentmariadbwrongdbtype');
|
||||
return $result;
|
||||
}
|
||||
|
||||
/// And finally compare them, saving results
|
||||
if (version_compare($current_version, $needed_version, '>=')) {
|
||||
$result->setStatus(true);
|
||||
|
Loading…
x
Reference in New Issue
Block a user