From cf89052aaed6404d3ab498c99a7b726a7a2965da Mon Sep 17 00:00:00 2001 From: stronk7 Date: Wed, 11 Feb 2009 16:16:52 +0000 Subject: [PATCH] MDL-18200 installer - create dataroot dir if possible --- install.php | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/install.php b/install.php index ed8060ad37..e6661c453f 100644 --- a/install.php +++ b/install.php @@ -270,7 +270,22 @@ if ($config->stage == INSTALL_DOWNLOADLANG) { $hint_dataroot = get_string('pathsunsecuredataroot', 'install'); $config->stage = INSTALL_PATHS; - } else if (!is_writable($CFG->dataroot)) { + } else if (!file_exists($CFG->dataroot)) { + $a = new stdClass(); + $a->parent = dirname($CFG->dataroot); + $a->dataroot = $CFG->dataroot; + if (!is_writable(dirname($CFG->dataroot))) { + $hint_dataroot = get_string('pathsroparentdataroot', 'install', $a); + $config->stage = INSTALL_PATHS; + } else { + if (!make_upload_directory(false, false)) { + $hint_dataroot = get_string('pathserrcreatedataroot', 'install', $a); + $config->stage = INSTALL_PATHS; + } + } + } + + if (empty($hint_dataroot) and !is_writable($CFG->dataroot)) { $hint_dataroot = get_string('pathsrodataroot', 'install'); $config->stage = INSTALL_PATHS; } -- 2.39.5