Skip to content

Commit

Permalink
MDL-28701 Fixed broken $CFG->tempdir default and added $CFG->cachedir
Browse files Browse the repository at this point in the history
  • Loading branch information
tomlanyon authored and skodak committed Sep 10, 2011
1 parent 7aa06e6 commit 383d388
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/setup.php
Expand Up @@ -37,6 +37,7 @@
* - $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.
* - $CFG->cachedir - Path to moodle's cache directory on server's filesystem.
*
* @global object $CFG
* @name $CFG
Expand Down Expand Up @@ -97,9 +98,14 @@
// Set up some paths.
$CFG->libdir = $CFG->dirroot .'/lib';

// Allow overriding of tempdir but be backwards compatible with tempdir
// Allow overriding of tempdir but be backwards compatible
if (!isset($CFG->tempdir)) {
$CFG->tempdir = "$CFG->tempdir";
$CFG->tempdir = "$CFG->dataroot/temp";
}

// Allow overriding of cachedir but be backwards compatible
if (!isset($CFG->cachedir)) {
$CFG->cachedir = "$CFG->dataroot/cache";
}

// The current directory in PHP version 4.3.0 and above isn't necessarily the
Expand Down

0 comments on commit 383d388

Please sign in to comment.