]> git.mjollnir.org Git - moodle.git/commitdiff
Changes to support various types of databases (using SQL code in lib/db)
authormartin <martin>
Mon, 27 May 2002 13:02:48 +0000 (13:02 +0000)
committermartin <martin>
Mon, 27 May 2002 13:02:48 +0000 (13:02 +0000)
admin/index.php

index b6fdd252d13e81b897f0850be70b010e15562863..affe3b3e7a1eca67002ddc986f1dda85afa20ad9 100644 (file)
@@ -3,17 +3,22 @@
     require("../config.php");
 
 
-    if (! $CFG->wwwroot == "http://example.com") {
+    if ($CFG->wwwroot == "http://example.com/moodle") {
         error("Moodle has not been configured yet.  You need to to edit config.php first.");
     }
 
     // Check databases and modules and install as needed.
     if (! $db->Metatables() ) { 
         print_header("Setting up database", "Setting up database", "Setting up databases for the first time", "");
-        if (modify_database("$CFG->dirroot/admin/moodle-core.sql")) {
-            notify("Main databases set up successfully");
+
+        if (file_exists("$CFG->libdir/db/$CFG->dbtype.sql")) {
+            if (modify_database("$CFG->libdir/db/$CFG->dbtype.sql")) {
+                notify("Main databases set up successfully");
+            } else {
+                error("Error: Main databases NOT set up successfully");
+            }
         } else {
-            error("Error: Main databases NOT set up successfully");
+            error("Error: Your database ($CFG->dbtype) is not yet supported by Moodle.  See the lib/db directory.");
         }
         print_heading("<A HREF=\"index.php\">Continue</A>");
         die;