]> source.dussan.org Git - nextcloud-server.git/commitdiff
add temporary filestorage backend for testing purposed
authorRobin Appelman <icewind@owncloud.com>
Fri, 11 May 2012 18:33:43 +0000 (20:33 +0200)
committerRobin Appelman <icewind@owncloud.com>
Fri, 11 May 2012 18:33:56 +0000 (20:33 +0200)
lib/filestorage/local.php
lib/filestorage/temporary.php [new file with mode: 0644]

index bd757f52ce76725dbc9a99a5f188c72690836fd0..ea9a907026358d69b31e7e243b0208d01c87317e 100644 (file)
@@ -3,7 +3,7 @@
  * for local filestore, we only have to map the paths
  */
 class OC_Filestorage_Local extends OC_Filestorage{
-       private $datadir;
+       protected $datadir;
        private static $mimetypes=null;
        public function __construct($arguments){
                $this->datadir=$arguments['datadir'];
diff --git a/lib/filestorage/temporary.php b/lib/filestorage/temporary.php
new file mode 100644 (file)
index 0000000..8f2373c
--- /dev/null
@@ -0,0 +1,17 @@
+<?php
+/**
+ * local storage backnd in temporary folder for testing purpores
+ */
+class OC_Filestorage_Temporary extends OC_Filestorage_Local{
+       public function __construct($arguments){
+               $this->datadir=OC_Helper::tmpFolder();
+       }
+
+       public function cleanUp(){
+               OC_Helper::rmdirr($this->datadir);
+       }
+
+       public function __destruct(){
+               $this->cleanUp();
+       }
+}