From 6a521a57adfec9084ad087d49886d5cd54f1737f Mon Sep 17 00:00:00 2001 From: Christian Mehldau Date: Thu, 13 Apr 2017 16:45:36 +0200 Subject: [PATCH] Closes #2 by adding the possibility to extract archived files with their full paths to the decompress-method while keeping default behaviour. --- SevenZipArchive.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/SevenZipArchive.php b/SevenZipArchive.php index d708484..c6fe6f6 100644 --- a/SevenZipArchive.php +++ b/SevenZipArchive.php @@ -122,10 +122,12 @@ public function compress() } } - public function decompress() + public function decompress($withFullPath=false) { + $extractFlag = $withFullPath ? 'x' : 'e'; + $command = '"' . $this->_executablePath . '"' - . ' e' + . " {$extractFlag}" . ' -y' . $this->_getPasswordParam() . ' ' . escapeshellarg($this->_archivePath)