improved error message for savedir paths (FS#2502)
This commit is contained in:
parent
db53782eba
commit
6b9c156c2d
15
inc/init.php
15
inc/init.php
|
@ -234,9 +234,12 @@ function init_paths(){
|
|||
'tmpdir' => 'tmp');
|
||||
|
||||
foreach($paths as $c => $p){
|
||||
if(empty($conf[$c])) $conf[$c] = $conf['savedir'].'/'.$p;
|
||||
$conf[$c] = init_path($conf[$c]);
|
||||
if(empty($conf[$c])) nice_die("The $c ('$p') does not exist, isn't accessible or writable.
|
||||
$path = $conf[$c];
|
||||
if(empty($path))
|
||||
$path = $conf['savedir'].'/'.$p;
|
||||
$conf[$c] = init_path($path);
|
||||
if(empty($conf[$c]))
|
||||
nice_die("The $c ('$p') at $path is not found, isn't accessible or writable.
|
||||
You should check your config and permission settings.
|
||||
Or maybe you want to <a href=\"install.php\">run the
|
||||
installer</a>?");
|
||||
|
@ -265,7 +268,7 @@ function init_lang($langCode) {
|
|||
}
|
||||
|
||||
/**
|
||||
* Checks the existance of certain files and creates them if missing.
|
||||
* Checks the existence of certain files and creates them if missing.
|
||||
*/
|
||||
function init_files(){
|
||||
global $conf;
|
||||
|
@ -312,7 +315,7 @@ function init_files(){
|
|||
* @author Andreas Gohr <andi@splitbrain.org>
|
||||
*/
|
||||
function init_path($path){
|
||||
// check existance
|
||||
// check existence
|
||||
$p = fullpath($path);
|
||||
if(!@file_exists($p)){
|
||||
$p = fullpath(DOKU_INC.$path);
|
||||
|
@ -560,7 +563,7 @@ function fullpath($path,$exists=false){
|
|||
}
|
||||
$finalpath = $root.implode('/', $newpath);
|
||||
|
||||
// check for existance when needed (except when unit testing)
|
||||
// check for existence when needed (except when unit testing)
|
||||
if($exists && !defined('DOKU_UNITTEST') && !@file_exists($finalpath)) {
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue