|
|
|
|
@ -95,11 +95,7 @@ class FileInfo implements \OCP\Files\FileInfo, \ArrayAccess {
|
|
|
|
|
unset($this->data[$offset]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return mixed
|
|
|
|
|
*/
|
|
|
|
|
#[\ReturnTypeWillChange]
|
|
|
|
|
public function offsetGet($offset) {
|
|
|
|
|
public function offsetGet(mixed $offset): mixed {
|
|
|
|
|
return match ($offset) {
|
|
|
|
|
'type' => $this->getType(),
|
|
|
|
|
'etag' => $this->getEtag(),
|
|
|
|
|
@ -164,7 +160,7 @@ class FileInfo implements \OCP\Files\FileInfo, \ArrayAccess {
|
|
|
|
|
* @return string
|
|
|
|
|
*/
|
|
|
|
|
public function getEtag() {
|
|
|
|
|
$this->updateEntryfromSubMounts();
|
|
|
|
|
$this->updateEntryFromSubMounts();
|
|
|
|
|
if (count($this->childEtags) > 0) {
|
|
|
|
|
$combinedEtag = $this->data['etag'] . '::' . implode('::', $this->childEtags);
|
|
|
|
|
return md5($combinedEtag);
|
|
|
|
|
@ -179,7 +175,7 @@ class FileInfo implements \OCP\Files\FileInfo, \ArrayAccess {
|
|
|
|
|
*/
|
|
|
|
|
public function getSize($includeMounts = true) {
|
|
|
|
|
if ($includeMounts) {
|
|
|
|
|
$this->updateEntryfromSubMounts();
|
|
|
|
|
$this->updateEntryFromSubMounts();
|
|
|
|
|
|
|
|
|
|
if ($this->isEncrypted() && isset($this->data['unencrypted_size']) && $this->data['unencrypted_size'] > 0) {
|
|
|
|
|
return $this->data['unencrypted_size'];
|
|
|
|
|
@ -195,7 +191,7 @@ class FileInfo implements \OCP\Files\FileInfo, \ArrayAccess {
|
|
|
|
|
* @return int
|
|
|
|
|
*/
|
|
|
|
|
public function getMTime() {
|
|
|
|
|
$this->updateEntryfromSubMounts();
|
|
|
|
|
$this->updateEntryFromSubMounts();
|
|
|
|
|
return (int)$this->data['mtime'];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -318,7 +314,7 @@ class FileInfo implements \OCP\Files\FileInfo, \ArrayAccess {
|
|
|
|
|
$this->subMounts = $mounts;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private function updateEntryfromSubMounts(): void {
|
|
|
|
|
private function updateEntryFromSubMounts(): void {
|
|
|
|
|
if ($this->subMountsUsed) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|