set_config('unicodedb', $CFG->unicodedb);
}
}
+
/// Set the client/server and connection to utf8 if necessary
/// and configure some other specific variables for each db
configure_dbconnection();
}
}
+/// Moodle 1.8 needs to be run on unicode, kill if not unicodedb
+ if (!$CFG->unicodedb) {
+ print_error('unicoderequired', 'admin');
+ }
+
?>
*/
function setup_is_unicodedb() {
- global $CFG, $db;
+ global $CFG, $db, $INSTALL;
$unicodedb = false;
+
+ // Since this function is also used during installation process, i.e. during install.php before $CFG->dbtype is set.
+ // we need to get dbtype from the right variable
+ if (!empty($INSTALL['dbtype'])) {
+ $dbtype = $INSTALL['dbtype'];
+ } else {
+ $dbtype = $CFG->dbtype;
+ }
- switch ($CFG->dbtype) {
+ switch ($dbtype) {
case 'mysql':
- /// Get MySQL character_set_database value
$rs = $db->Execute("SHOW VARIABLES LIKE 'character_set_database'");
if ($rs && $rs->RecordCount() > 0) {
$records = $rs->GetAssoc(true);