]> git.mjollnir.org Git - moodle.git/commitdiff
Moving $CFG->ostype and $CFG->os setting, because
authorstronk7 <stronk7>
Fri, 7 Apr 2006 22:58:07 +0000 (22:58 +0000)
committerstronk7 <stronk7>
Fri, 7 Apr 2006 22:58:07 +0000 (22:58 +0000)
report_session_error() was being executed before setting
such variables and moodle_setlocale() need them.
(http://moodle.org/mod/forum/discuss.php?d=43466)

lib/setup.php

index f651012d2ebd3a13e59af4e7931bdf2e5631e5f0..ff4cb99dbd67032c916f10ce72b6770c1cc4000d 100644 (file)
@@ -249,6 +249,17 @@ global $HTTPSPAGEREQUIRED;
         $CFG->directorypermissions = 0777;      // Must be octal (that's why it's here)
     }
 
+/// Calculate and set $CFG->ostype to be used everywhere. Possible values are:
+/// - WINDOWS: for any Windows flavour.
+/// - UNIX: for the rest
+/// Also, $CFG->os can continue being used if more specialization is required
+if (stristr(PHP_OS, 'win') && !stristr(PHP_OS, 'darwin')) {
+    $CFG->ostype = 'WINDOWS';
+} else {
+    $CFG->ostype = 'UNIX';
+}
+$CFG->os = PHP_OS;
+
 /// Setup cache dir for Smarty and others
     if (!file_exists($CFG->dataroot .'/cache')) {
         make_upload_directory('cache');
@@ -476,17 +487,6 @@ global $HTTPSPAGEREQUIRED;
     }
 
 
-/// Calculate and set $CFG->ostype to be used everywhere. Possible values are:
-/// - WINDOWS: for any Windows flavour.
-/// - UNIX: for the rest
-/// Also, $CFG->os can continue being used if more specialization is required
-if (stristr(PHP_OS, 'win') && !stristr(PHP_OS, 'darwin')) {
-    $CFG->ostype = 'WINDOWS';
-} else {
-    $CFG->ostype = 'UNIX';
-}
-$CFG->os = PHP_OS;
-
 /// Set language/locale of printed times.  If user has chosen a language that
 /// that is different from the site language, then use the locale specified
 /// in the language file.  Otherwise, if the admin hasn't specified a locale