]> git.mjollnir.org Git - moodle.git/commitdiff
Two new $CFG runtime variables created $CFG->ostype (WINDOWS, UNIX) and
authorstronk7 <stronk7>
Thu, 23 Mar 2006 17:54:33 +0000 (17:54 +0000)
committerstronk7 <stronk7>
Thu, 23 Mar 2006 17:54:33 +0000 (17:54 +0000)
$CFG->os (= PHP_OS) to handle it centrally. Also, although not critical,
it should be recommended to replace all the current uses of PHP_OS to the
new variables. See bug 4968.
(http://moodle.org/bugs/bug.php?op=show&bugid=4968)

lib/setup.php

index 16860a354bd8dc3f3652e5763ee66aac6efd8bfe..bfb55dcd30f5f6521385476ef6a2a220cbb315b0 100644 (file)
@@ -446,6 +446,16 @@ 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