aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/lib/Cache.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_sharing/lib/Cache.php')
-rw-r--r--apps/files_sharing/lib/Cache.php26
1 files changed, 12 insertions, 14 deletions
diff --git a/apps/files_sharing/lib/Cache.php b/apps/files_sharing/lib/Cache.php
index 26a9bc7b524..f9042fc0765 100644
--- a/apps/files_sharing/lib/Cache.php
+++ b/apps/files_sharing/lib/Cache.php
@@ -1,4 +1,5 @@
<?php
+
/**
* SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
@@ -27,29 +28,22 @@ use OCP\Share\IShare;
* don't use this class directly if you need to get metadata, use \OC\Files\Filesystem::getFileInfo instead
*/
class Cache extends CacheJail {
- /** @var SharedStorage */
- private $storage;
- private ICacheEntry $sourceRootInfo;
private bool $rootUnchanged = true;
private ?string $ownerDisplayName = null;
private $numericId;
private DisplayNameCache $displayNameCache;
- private IShare $share;
/**
* @param SharedStorage $storage
*/
public function __construct(
- $storage,
- ICacheEntry $sourceRootInfo,
+ private $storage,
+ private ICacheEntry $sourceRootInfo,
CacheDependencies $dependencies,
- IShare $share
+ private IShare $share,
) {
- $this->storage = $storage;
- $this->sourceRootInfo = $sourceRootInfo;
- $this->numericId = $sourceRootInfo->getStorageId();
+ $this->numericId = $this->sourceRootInfo->getStorageId();
$this->displayNameCache = $dependencies->getDisplayNameCache();
- $this->share = $share;
parent::__construct(
null,
@@ -70,12 +64,12 @@ class Cache extends CacheJail {
/** @var Jail $currentStorage */
$absoluteRoot = $currentStorage->getJailedPath($absoluteRoot);
}
- $this->root = $absoluteRoot;
+ $this->root = $absoluteRoot ?? '';
}
return $this->root;
}
- protected function getGetUnjailedRoot() {
+ public function getGetUnjailedRoot(): string {
return $this->sourceRootInfo->getPath();
}
@@ -122,7 +116,7 @@ class Cache extends CacheJail {
parent::remove($file);
}
- public function moveFromCache(\OCP\Files\Cache\ICache $sourceCache, $sourcePath, $targetPath) {
+ public function moveFromCache(ICache $sourceCache, $sourcePath, $targetPath) {
$this->rootUnchanged = false;
return parent::moveFromCache($sourceCache, $sourcePath, $targetPath);
}
@@ -198,4 +192,8 @@ class Cache extends CacheJail {
return null;
}
}
+
+ public function markRootChanged(): void {
+ $this->rootUnchanged = false;
+ }
}