2012-09-07 12:30:48 -04:00
|
|
|
<?php
|
2024-05-23 03:26:56 -04:00
|
|
|
|
2012-09-07 12:30:48 -04:00
|
|
|
/**
|
2024-05-23 03:26:56 -04:00
|
|
|
* SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
|
|
|
|
|
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
|
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
2012-09-07 12:30:48 -04:00
|
|
|
*/
|
|
|
|
|
namespace OC\Files\Storage;
|
|
|
|
|
|
|
|
|
|
/**
|
2013-02-05 10:24:40 -05:00
|
|
|
* local storage backend in temporary folder for testing purpose
|
2012-09-07 12:30:48 -04:00
|
|
|
*/
|
2012-09-22 09:03:17 -04:00
|
|
|
class Temporary extends Local {
|
2024-09-15 11:14:37 -04:00
|
|
|
public function __construct($arguments = []) {
|
2020-03-26 04:30:18 -04:00
|
|
|
parent::__construct(['datadir' => \OC::$server->getTempManager()->getTemporaryFolder()]);
|
2012-09-07 12:30:48 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function cleanUp() {
|
|
|
|
|
\OC_Helper::rmdirr($this->datadir);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function __destruct() {
|
2013-02-09 11:16:13 -05:00
|
|
|
parent::__destruct();
|
2012-09-07 12:30:48 -04:00
|
|
|
$this->cleanUp();
|
|
|
|
|
}
|
2014-06-05 15:00:50 -04:00
|
|
|
|
|
|
|
|
public function getDataDir() {
|
|
|
|
|
return $this->datadir;
|
|
|
|
|
}
|
2012-09-07 12:30:48 -04:00
|
|
|
}
|