diff options
author | Andreas Gohr <andi@splitbrain.org> | 2008-08-23 11:26:42 +0200 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2008-08-23 11:26:42 +0200 |
commit | 010720ca07eb2a3f6c828b61e247f1aeaaef503d (patch) | |
tree | f0a993822052c4afc019250c2c6343ae5f057930 | |
parent | 287f35bdd79188adfae32b08effacb9642e219d6 (diff) | |
download | rpg-010720ca07eb2a3f6c828b61e247f1aeaaef503d.tar.gz rpg-010720ca07eb2a3f6c828b61e247f1aeaaef503d.tar.bz2 |
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
-rw-r--r-- | lib/plugins/plugin/admin.php | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/plugins/plugin/admin.php b/lib/plugins/plugin/admin.php index 573d8ebe3..3049d4108 100644 --- a/lib/plugins/plugin/admin.php +++ b/lib/plugins/plugin/admin.php @@ -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"); |