Commit b1c9124a authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Don't attempt to install on MySQL if InnoDB tables are disabled; warn if db not UTF-8 (bug #650)

parent 3f567eb7
......@@ -59,6 +59,10 @@ $coresuccess = json_encode(get_string('coredatasuccess', 'admin'));
if (!empty($upgrades['core']->install)) {
$upgrades['firstcoredata'] = true;
$upgrades['lastcoredata'] = true;
if (!db_is_utf8()) {
global $SESSION;
$SESSION->add_info_msg(get_string('databasenotutf8', 'admin'));
}
$smarty->assign('install', true);
}
......
......@@ -37,6 +37,7 @@ $string['component'] = 'Component or plugin';
$string['continue'] = 'Continue';
$string['coredata'] = 'core data';
$string['coredatasuccess'] = 'Successfully installed core data';
$string['databasenotutf8'] = 'You are not using a UTF-8 database. UTF-8 is the recommended character encoding for Mahara.';
$string['fromversion'] = 'From version';
$string['information'] = 'Information';
$string['installsuccess'] = 'Successfully installed version ';
......
......@@ -61,6 +61,13 @@ function check_upgrades($name=null) {
$coreversion = 0;
}
if (empty($coreversion)) {
if (is_mysql()) { // Show a more informative error message if using mysql with skip-innodb
global $db;
$result = $db->Execute("SHOW VARIABLES LIKE 'have_innodb'");
if ($result->fields['Value'] != 'YES') {
throw new ConfigSanityException("Mahara requires InnoDB tables. Please ensure InnoDB tables are enabled in your MySQL server.");
}
}
$core = new StdClass;
$core->install = true;
$core->to = $config->version;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment