From 6b9c156c2d804458adf7d057c5c021d4c4658a9d Mon Sep 17 00:00:00 2001 From: Anika Henke Date: Sun, 27 May 2012 11:51:32 +0100 Subject: [PATCH] improved error message for savedir paths (FS#2502) --- inc/init.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/inc/init.php b/inc/init.php index d57e12d7b..923bda352 100644 --- a/inc/init.php +++ b/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 run the installer?"); @@ -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 */ 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; }