Skip to content

Commit

Permalink
MDL-18200 installer - create dataroot dir if possible
Browse files Browse the repository at this point in the history
  • Loading branch information
stronk7 committed Feb 11, 2009
1 parent b10a14a commit cf89052
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion install.php
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,22 @@
$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;
}
Expand Down

0 comments on commit cf89052

Please sign in to comment.