MDL-28701 Fixed broken $CFG->tempdir default and added $CFG->cachedir

This commit is contained in:
Tom Lanyon 2011-08-11 03:23:26 +09:30 committed by Petr Skoda
parent 7aa06e6ded
commit 383d388411

View File

@ -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
@ -97,9 +98,14 @@ if (!isset($CFG->admin)) { // Just in case it isn't defined in config.php
// 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