temporary.php 656 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. /**
  3. * Copyright (c) 2012 Robin Appelman <icewind@owncloud.com>
  4. * This file is licensed under the Affero General Public License version 3 or
  5. * later.
  6. * See the COPYING-README file.
  7. */
  8. namespace OC\Files\Storage;
  9. /**
  10. * local storage backend in temporary folder for testing purpose
  11. */
  12. class Temporary extends Local{
  13. public function __construct($arguments) {
  14. parent::__construct(array('datadir' => \OC_Helper::tmpFolder()));
  15. }
  16. public function cleanUp() {
  17. \OC_Helper::rmdirr($this->datadir);
  18. }
  19. public function __destruct() {
  20. parent::__destruct();
  21. $this->cleanUp();
  22. }
  23. public function getDataDir() {
  24. return $this->datadir;
  25. }
  26. }