From fbe33209ce30131bb481f99b18d3ef0b155fbce9 Mon Sep 17 00:00:00 2001 From: David Mudrak Date: Mon, 21 Nov 2011 16:49:40 +0100 Subject: [PATCH] MDL-30381 install_init_dataroot() now creates temp and cache This prevents PHP warnings displayed due to recent modifications in make_temp_dir() and make_cache_dir(). These functions now expect that the root temp/cache dir already exists. So they must be available before the lang_installer installs the lang pack during install. --- lib/installlib.php | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/lib/installlib.php b/lib/installlib.php index c6cb423c187..566bc8cb3c6 100644 --- a/lib/installlib.php +++ b/lib/installlib.php @@ -106,7 +106,27 @@ function install_init_dataroot($dataroot, $dirpermissions) { return false; // we can not continue } - // now create the lang folder - we need it and it makes sure we can really write in dataroot + // create the directory for $CFG->tempdir + if (!is_dir("$dataroot/temp")) { + if (!mkdir("$dataroot/temp", $dirpermissions, true)) { + return false; + } + } + if (!is_writable("$dataroot/temp")) { + return false; // we can not continue + } + + // create the directory for $CFG->cachedir + if (!is_dir("$dataroot/cache")) { + if (!mkdir("$dataroot/cache", $dirpermissions, true)) { + return false; + } + } + if (!is_writable("$dataroot/cache")) { + return false; // we can not continue + } + + // create the directory for $CFG->langotherroot if (!is_dir("$dataroot/lang")) { if (!mkdir("$dataroot/lang", $dirpermissions, true)) { return false; -- 2.43.0