From: moodler Date: Mon, 26 May 2003 01:54:11 +0000 (+0000) Subject: Checking in the include error code in again, with improvements X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=f7a6049e57b1b7c21eb9626efcb8dfc30e4a0025;p=moodle.git Checking in the include error code in again, with improvements The problems I thought were happening were in fact another problem on someone's installation (missing files). This code now checks for that too. --- diff --git a/config-dist.php b/config-dist.php index 84fdf6f884..e8c129ef52 100644 --- a/config-dist.php +++ b/config-dist.php @@ -121,10 +121,20 @@ $CFG->admin = 'admin'; //========================================================================= -// ALL DONE! To continue your setup, visit your Moodle page with a browser +// ALL DONE! To continue installation, visit your main page with a browser //========================================================================= -require_once("$CFG->dirroot/lib/setup.php"); // Do not change this +if (! @include_once("$CFG->dirroot/lib/setup.php")) { // Do not edit + if ($CFG->dirroot == dirname(__FILE__)) { + echo "

Could not find this file: $CFG->dirroot/lib/setup.php

"; + echo "

Are you sure all your files have been uploaded?

"; + } else { + echo "

Error detected in config.php

"; + echo "

Error in: \$CFG->dirroot = '$CFG->dirroot';

"; + echo "

Try this: \$CFG->dirroot = '".dirname(__FILE__)."';

"; + } + die; +} // MAKE SURE WHEN YOU EDIT THIS FILE THAT THERE ARE NO SPACES, BLANK LINES, // RETURNS, OR ANYTHING ELSE AFTER THE TWO CHARACTERS ON THE NEXT LINE.