diff options
author | Robin Appelman <icewind@owncloud.com> | 2012-03-28 22:31:45 +0200 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2012-03-28 23:47:44 +0200 |
commit | e57de98bbedfbf71841235fe01b10787d5e41962 (patch) | |
tree | ee13246387822d88901e8f2b7017ab9687ac8d0a /apps/files_archive/lib | |
parent | d8e9db207f94d8a46cd8a81caa1b49cd64843259 (diff) | |
download | nextcloud-server-e57de98bbedfbf71841235fe01b10787d5e41962.tar.gz nextcloud-server-e57de98bbedfbf71841235fe01b10787d5e41962.zip |
add extract all option to OC_Archive
Diffstat (limited to 'apps/files_archive/lib')
-rw-r--r-- | apps/files_archive/lib/archive.php | 7 | ||||
-rw-r--r-- | apps/files_archive/lib/zip.php | 9 |
2 files changed, 16 insertions, 0 deletions
diff --git a/apps/files_archive/lib/archive.php b/apps/files_archive/lib/archive.php index be89f894fb7..3be3388a3b0 100644 --- a/apps/files_archive/lib/archive.php +++ b/apps/files_archive/lib/archive.php @@ -78,6 +78,13 @@ abstract class OC_Archive{ */ abstract function extractFile($path,$dest); /** + * extract the archive + * @param string path + * @param string dest + * @return bool + */ + abstract function extract($dest); + /** * check if a file or folder exists in the archive * @param string path * @return bool diff --git a/apps/files_archive/lib/zip.php b/apps/files_archive/lib/zip.php index eab101b3a5c..16f2273f443 100644 --- a/apps/files_archive/lib/zip.php +++ b/apps/files_archive/lib/zip.php @@ -129,6 +129,15 @@ class OC_Archive_ZIP extends OC_Archive{ file_put_contents($dest,$fp); } /** + * extract the archive + * @param string path + * @param string dest + * @return bool + */ + function extract($dest){ + return $this->zip->extractTo($dest); + } + /** * check if a file or folder exists in the archive * @param string path * @return bool |