From 9ae302a5d9602254ebbcef31b4bd60b064ba81ff Mon Sep 17 00:00:00 2001 From: Michael Kliewe Date: Wed, 4 Apr 2012 23:11:01 +0200 Subject: [PATCH] added checkExecutable() and getDebug() methods, thanks Robert! --- SevenZipArchive.php | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/SevenZipArchive.php b/SevenZipArchive.php index 3977d4b..d708484 100644 --- a/SevenZipArchive.php +++ b/SevenZipArchive.php @@ -1,5 +1,17 @@ _executablePath); + if (strpos($ret, "7-Zip") === false) { + return false; + } else { + return true; + } + } + + public function getDebug() + { + return $this->_debug; + } public function setExecutablePath($path) { @@ -86,6 +117,7 @@ public function compress() if (strpos($ret, 'Everything is Ok')!==false) { // compression was successful return true; } else { + $this->_debug = $ret; return false; } } @@ -104,6 +136,7 @@ public function decompress() if (strpos($ret, 'Everything is Ok')!==false) { // decompression was successful return true; } else { // password wrong or bad integrity + $this->_debug = $ret; return false; } } @@ -120,6 +153,7 @@ public function verify() if (strpos($ret, 'Everything is Ok')!==false) { // verification was successful return true; } else { // password wrong or bad integrity + $this->_debug = $ret; return false; } }