]> git.mjollnir.org Git - moodle.git/commitdiff
Checking in the include error code in again, with improvements
authormoodler <moodler>
Mon, 26 May 2003 01:54:11 +0000 (01:54 +0000)
committermoodler <moodler>
Mon, 26 May 2003 01:54:11 +0000 (01:54 +0000)
The problems I thought were happening were in fact another problem
on someone's installation (missing files).  This code now checks
for that too.

config-dist.php

index 84fdf6f884b3752139cd6ab1b2979d3df5daa26a..e8c129ef52da2eef25983c1dc99e839bdc68f8e2 100644 (file)
@@ -121,10 +121,20 @@ $CFG->admin = 'admin';
 \r
 \r
 //=========================================================================\r
-// ALL DONE!  To continue your setup, visit your Moodle page with a browser\r
+// ALL DONE!  To continue installation, visit your main page with a browser\r
 //=========================================================================\r
 \r
-require_once("$CFG->dirroot/lib/setup.php");    // Do not change this\r
+if (! @include_once("$CFG->dirroot/lib/setup.php"))  {       // Do not edit\r
+    if ($CFG->dirroot == dirname(__FILE__)) {\r
+        echo "<p>Could not find this file: $CFG->dirroot/lib/setup.php</p>";\r
+        echo "<p>Are you sure all your files have been uploaded?</p>";\r
+    } else {\r
+        echo "<p>Error detected in config.php</p>";\r
+        echo "<p>Error in: \$CFG->dirroot = '$CFG->dirroot';</p>";\r
+        echo "<p>Try this: \$CFG->dirroot = '".dirname(__FILE__)."';</p>";\r
+    }\r
+    die;\r
+}\r
 \r
 // MAKE SURE WHEN YOU EDIT THIS FILE THAT THERE ARE NO SPACES, BLANK LINES, \r
 // RETURNS, OR ANYTHING ELSE AFTER THE TWO CHARACTERS ON THE NEXT LINE.\r