Permalink
Browse files

Changes to support various types of databases (using SQL code in lib/db)

  • Loading branch information...
1 parent 27dd018 commit 65c687a5dce624fa407b725af79b859d0e3dd86c martin committed May 27, 2002
Showing with 9 additions and 4 deletions.
  1. +9 −4 admin/index.php
View
@@ -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;

0 comments on commit 65c687a

Please sign in to comment.