mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
MDL-30621 prevent warnings when creating temp and cache dirs
This commit is contained in:
parent
f89a83b87b
commit
adf0fc0e42
@ -1193,7 +1193,10 @@ function make_upload_directory($directory, $exceptiononerror = true) {
|
||||
*/
|
||||
function make_temp_directory($directory, $exceptiononerror = true) {
|
||||
global $CFG;
|
||||
protect_directory($CFG->tempdir);
|
||||
if ($CFG->tempdir !== "$CFG->dataroot/temp") {
|
||||
check_dir_exists($CFG->tempdir, true, true);
|
||||
protect_directory($CFG->tempdir);
|
||||
}
|
||||
return make_writable_directory("$CFG->tempdir/$directory", $exceptiononerror);
|
||||
}
|
||||
|
||||
@ -1206,7 +1209,10 @@ function make_temp_directory($directory, $exceptiononerror = true) {
|
||||
*/
|
||||
function make_cache_directory($directory, $exceptiononerror = true) {
|
||||
global $CFG;
|
||||
protect_directory($CFG->cachedir);
|
||||
if ($CFG->cachedir !== "$CFG->dataroot/cache") {
|
||||
check_dir_exists($CFG->cachedir, true, true);
|
||||
protect_directory($CFG->cachedir);
|
||||
}
|
||||
return make_writable_directory("$CFG->cachedir/$directory", $exceptiononerror);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user