Permalink
Browse files

MDL-28701 Added $CFG->tempdir setting

  • Loading branch information...
1 parent 5d2db8a commit 3e9398714247f009cbfdc6b626de65ff00ede7a6 @tomlanyon tomlanyon committed with skodak Aug 10, 2011
Showing with 6 additions and 0 deletions.
  1. +6 −0 lib/setup.php
View
@@ -36,6 +36,7 @@
* - $CFG->dataroot - Path to moodle data files directory on server's filesystem.
* - $CFG->dirroot - Path to moodle's library folder on server's filesystem.
* - $CFG->libdir - Path to moodle's library folder on server's filesystem.
+ * - $CFG->tempdir - Path to moodle's temp file directory on server's filesystem.
*
* @global object $CFG
* @name $CFG
@@ -96,6 +97,11 @@
// Set up some paths.
$CFG->libdir = $CFG->dirroot .'/lib';
+// Allow overriding of tempdir but be backwards compatible with dataroot/temp
+if (!isset($CFG->tempdir)) {
+ $CFG->tempdir = "$CFG->dataroot/temp";
+}
+
// The current directory in PHP version 4.3.0 and above isn't necessarily the
// directory of the script when run from the command line. The require_once()
// would fail, so we'll have to chdir()

0 comments on commit 3e93987

Please sign in to comment.