Merge pull request #57893 from nextcloud/carl/cachemountinfo-refactor

This commit is contained in:
Kate 2026-01-29 15:10:22 +01:00 committed by GitHub
commit 400fe317e9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -13,45 +13,21 @@ use OCP\Files\Node;
use OCP\IUser;
class CachedMountInfo implements ICachedMountInfo {
protected IUser $user;
protected int $storageId;
protected int $rootId;
protected string $mountPoint;
protected ?int $mountId;
protected string $rootInternalPath;
protected string $mountProvider;
protected string $key;
/**
* CachedMountInfo constructor.
*
* @param IUser $user
* @param int $storageId
* @param int $rootId
* @param string $mountPoint
* @param int|null $mountId
* @param string $rootInternalPath
*/
public function __construct(
IUser $user,
int $storageId,
int $rootId,
string $mountPoint,
string $mountProvider,
?int $mountId = null,
string $rootInternalPath = '',
protected IUser $user,
protected int $storageId,
protected int $rootId,
protected string $mountPoint,
protected string $mountProvider,
protected ?int $mountId = null,
protected string $rootInternalPath = '',
) {
$this->user = $user;
$this->storageId = $storageId;
$this->rootId = $rootId;
$this->mountPoint = $mountPoint;
$this->mountId = $mountId;
$this->rootInternalPath = $rootInternalPath;
if (strlen($mountProvider) > 128) {
throw new \Exception("Mount provider $mountProvider name exceeds the limit of 128 characters");
if (strlen($this->mountProvider) > 128) {
throw new \Exception("Mount provider $this->mountProvider name exceeds the limit of 128 characters");
}
$this->mountProvider = $mountProvider;
$this->key = $rootId . '::' . $mountPoint;
$this->key = $this->rootId . '::' . $this->mountPoint;
}
/**