From 65c687a5dce624fa407b725af79b859d0e3dd86c Mon Sep 17 00:00:00 2001 From: martin Date: Mon, 27 May 2002 13:02:48 +0000 Subject: [PATCH] Changes to support various types of databases (using SQL code in lib/db) --- admin/index.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/admin/index.php b/admin/index.php index b6fdd252d1..affe3b3e7a 100644 --- a/admin/index.php +++ b/admin/index.php @@ -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("Continue"); die; -- 2.39.5