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.
This commit is contained in:
David Mudrak 2011-11-21 16:49:40 +01:00
parent b907d3f58c
commit fbe33209ce

View File

@ -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;