]> git.mjollnir.org Git - moodle.git/commitdiff
merged, setting $CFG->unicodedb after converting db to unicode. Chaning the order...
authortoyomoyo <toyomoyo>
Fri, 20 Oct 2006 02:08:21 +0000 (02:08 +0000)
committertoyomoyo <toyomoyo>
Fri, 20 Oct 2006 02:08:21 +0000 (02:08 +0000)
lib/ddllib.php

index 9f76b37fc4c62cb487675f7c973e2aaff73d2d11..ea316768e94bad863dcdc4d4d3271e559a4f4d1a 100644 (file)
@@ -1145,13 +1145,13 @@ function rename_index($table, $index, $newname, $continue=true, $feedback=true)
 function change_db_encoding() {
     global $CFG, $db;  
     // try forcing utf8 collation, if mysql db and no tables present
-    if (!$db->Metatables() && ($CFG->dbtype=='mysql') && empty($CFG->unicodedb)) {
+    if (empty($CFG->unicodedb) && ($CFG->dbtype=='mysql') && !$db->Metatables()) {
         $SQL = 'ALTER DATABASE '.$CFG->dbname.' CHARACTER SET utf8';
         execute_sql($SQL, false); // silent, if it fails it fails
         if (setup_is_unicodedb()) {
-            // set_config('unicodedb','true'); // can not set config because there is no config table yet =(
+            $CFG->unicodedb = true;
             configure_dbconnection();   
-        } 
+        }
     }
 }