dont use the source cache/storage until needed

Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
Robin Appelman 2016-11-17 14:18:08 +01:00
parent 14cdeafc3e
commit 065753f0ae
No known key found for this signature in database
GPG Key ID: 425003AC385454C5
1 changed files with 9 additions and 15 deletions

View File

@ -42,39 +42,33 @@ class Cache extends CacheJail {
*/
private $storage;
/**
* @var IStorage
*/
private $sourceStorage;
/**
* @var ICacheEntry
*/
private $sourceRootInfo;
/**
* @var \OCP\Files\Cache\ICache
*/
private $sourceCache;
private $rootUnchanged = true;
/**
* @param \OCA\Files_Sharing\SharedStorage $storage
* @param IStorage $sourceStorage
* @param ICacheEntry $sourceRootInfo
*/
public function __construct($storage, IStorage $sourceStorage, ICacheEntry $sourceRootInfo) {
public function __construct($storage, ICacheEntry $sourceRootInfo) {
$this->storage = $storage;
$this->sourceStorage = $sourceStorage;
$this->sourceRootInfo = $sourceRootInfo;
$this->sourceCache = $sourceStorage->getCache();
parent::__construct(
$this->sourceCache,
null,
$this->sourceRootInfo->getPath()
);
}
public function getCache() {
if (is_null($this->cache)) {
$this->cache = $this->storage->getSourceStorage()->getCache();
}
return $this->cache;
}
public function getNumericStorageId() {
if (isset($this->numericId)) {
return $this->numericId;