Skip to content
Snippets Groups Projects
Commit 010720ca authored by Andreas Gohr's avatar Andreas Gohr
Browse files

Be more verbose on errors in plugin manager

handle "unknown" errors from TarLib and print all errors when
allowdeug is set

darcs-hash:20080823092642-7ad00-f2c827b422c9d49784c343804af2a0d71fb275ad.gz
parent 287f35bd
No related branches found
No related tags found
No related merge requests found
......@@ -625,6 +625,7 @@ class ap_manage {
// decompress wrapper
function ap_decompress($file, $target) {
global $conf;
// decompression library doesn't like target folders ending in "/"
if (substr($target, -1) == "/") $target = substr($target, 0, -1);
......@@ -642,9 +643,13 @@ class ap_manage {
$tar = new TarLib($file, $compress_type);
$ok = $tar->Extract(FULL_ARCHIVE, $target, '', 0777);
// FIXME sort something out for handling tar error messages meaningfully
return ($ok<0?false:true);
if($ok<1){
if($conf['allowdebug']){
msg('TarLib Error: '.$tar->TarErrorStr($ok),-1);
}
return false;
}
return true;
} else if ($ext == 'zip') {
require_once(DOKU_INC."inc/ZipLib.class.php");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment