MDL-60923 backup: Added $CFG->backuptempdir

The new setting will allow to host the temporary backup files
into a specific target directory. Defaults to '$CFG->tempdir/backup'.

Calling make_backup_temp_directory() checks that the required sub-directory
will be properly created under the new target directory.
This commit is contained in:
Matteo Scaramuccia
2018-04-16 23:50:28 +02:00
parent 20bf0c45ff
commit ef844148a9
36 changed files with 147 additions and 79 deletions
+6
View File
@@ -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->backuptempdir - Path to moodle's backup temp file directory 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 (shared by cluster nodes).
* - $CFG->localcachedir - Path to moodle's local cache directory (not shared by cluster nodes).
@@ -192,6 +193,11 @@ if (!isset($CFG->tempdir)) {
$CFG->tempdir = "$CFG->dataroot/temp";
}
// Allow overriding of backuptempdir but be backwards compatible
if (!isset($CFG->backuptempdir)) {
$CFG->backuptempdir = "$CFG->tempdir/backup";
}
// Allow overriding of cachedir but be backwards compatible
if (!isset($CFG->cachedir)) {
$CFG->cachedir = "$CFG->dataroot/cache";