Added "autocollect" function to TempFSFile.
authorAaron <aschulz@wikimedia.org>
Mon, 20 Aug 2012 19:15:42 +0000 (12:15 -0700)
committerAaron <aschulz@wikimedia.org>
Mon, 20 Aug 2012 19:15:49 +0000 (12:15 -0700)
* This is useful for declaring a temp file not generated via factory() as a temp file.

Change-Id: Iaa24ce3c3b0d1f7b3f492377f5bae40a1dd8869a

includes/filebackend/TempFSFile.php

index 00f1080..ed6bf2f 100644 (file)
@@ -99,6 +99,15 @@ class TempFSFile extends FSFile {
                $this->canDelete = false;
        }
 
+       /**
+        * Set flag clean up after the temporary file
+        *
+        * @return void
+        */
+       public function autocollect() {
+               $this->canDelete = true;
+       }
+
        /**
         * Cleans up after the temporary file by deleting it
         */