Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MDL-28701 Added $CFG->tempdir setting

  • Loading branch information...
commit 3e9398714247f009cbfdc6b626de65ff00ede7a6 1 parent 5d2db8a
@tomlanyon tomlanyon authored skodak committed
Showing with 6 additions and 0 deletions.
  1. +6 −0 lib/setup.php
View
6 lib/setup.php
@@ -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()
Please sign in to comment.
Something went wrong with that request. Please try again.