From 2ea46ee1ca6f95d05f8e05808729fe23d97d55ba Mon Sep 17 00:00:00 2001
From: Robin Appelman <icewind@owncloud.com>
Date: Sun, 19 Aug 2012 05:05:55 +0200
Subject: [PATCH] better file_get_contents, file_put_contents and toTmpFile for
 archive storage backend

---
 apps/files_archive/lib/storage.php | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/apps/files_archive/lib/storage.php b/apps/files_archive/lib/storage.php
index 8676166361..add00ed8d8 100644
--- a/apps/files_archive/lib/storage.php
+++ b/apps/files_archive/lib/storage.php
@@ -111,6 +111,19 @@ class OC_Filestorage_Archive extends OC_Filestorage_Common{
 			return false;//not supported
 		}
 	}
+	private function toTmpFile($path){
+		$tmpFile=OC_Helper::tmpFile($extension);
+		$this->archive->extractFile($path,$tmpFile);
+		return $tmpFile;
+	}
+	public function file_put_contents($path,$data) {
+		$path=$this->stripPath($path);
+		return $this->archive->addFile($path,$data);
+	}
+	public function file_get_contents($path) {
+		$path=$this->stripPath($path);
+		return $this->archive->getFile($path);
+	}
 
 	/**
 	 * automount paths from file hooks
-- 
GitLab