From 3816dcbc4fc7d70493037bf3ee9468ca5a203db8 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Fri, 3 Mar 2006 19:05:48 +0100 Subject: nicer error messages for fatal errors darcs-hash:20060303180548-7ad00-db294c2c5c10c8df69ebae7596e64e1af4d9bc35.gz --- inc/auth.php | 4 ++-- inc/init.php | 28 +++++++++++++++++++++++++--- 2 files changed, 27 insertions(+), 5 deletions(-) (limited to 'inc') diff --git a/inc/auth.php b/inc/auth.php index 79cae52e7..1efd42448 100644 --- a/inc/auth.php +++ b/inc/auth.php @@ -33,10 +33,10 @@ $conf['useacl'] = 0; } } else { - die($lang['authmodfailed']); + nice_die($lang['authmodfailed']); } } else { - die($lang['authmodfailed']); + nice_die($lang['authmodfailed']); } } diff --git a/inc/init.php b/inc/init.php index e4d2fac5b..31ad8d37c 100644 --- a/inc/init.php +++ b/inc/init.php @@ -128,7 +128,8 @@ function init_paths(){ foreach($paths as $c => $p){ if(!$conf[$c]) $conf[$c] = $conf['savedir'].'/'.$p; $conf[$c] = init_path($conf[$c]); - if(!$conf[$c]) die("$c does not exist, isn't accessable or writable. Check config and permissions!"); + if(!$conf[$c]) nice_die("The $c does not exist, isn't accessable or writable. + Check your config and permission settings!"); } } @@ -149,7 +150,7 @@ function init_files(){ fclose($fh); if(isset($conf['fmask'])) { chmod($file, $conf['fmask']); } }else{ - die("$file is not writable. Check permissions!"); + nice_die("$file is not writable. Check your permissions settings!"); } } } @@ -282,7 +283,7 @@ function scriptify($file) { } $fh = fopen($fn, 'w'); if (!$fh) { - die($fn.' is not writable!'); + nice_die($fn.' is not writable. Check your permission settings!'); } // write php exit hack first fwrite($fh, "# $fn\n"); @@ -299,5 +300,26 @@ function scriptify($file) { @rename($file,"$file.old"); } +/** + * print a nice message even if no styles are loaded yet. + */ +function nice_die($msg){ + echo<< + + DokuWiki Setup Error + +
+

DokuWiki Setup Error

+

$msg

+
+ + +EOT; + exit; +} + //Setup VIM: ex: et ts=2 enc=utf-8 : -- cgit v1.2.3