Skip to content

Commit

Permalink
fix: add moveFromStorage for objectstorage
Browse files Browse the repository at this point in the history
Signed-off-by: unteem <timothee@indie.host>
  • Loading branch information
unteem committed Jun 9, 2022
1 parent 211361d commit 5c41417
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions lib/private/Files/ObjectStore/ObjectStoreStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -611,4 +611,17 @@ private function copyFile(ICacheEntry $sourceEntry, string $to) {
throw $e;
}
}

public function moveFromStorage(IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath) {
while ($sourceStorage->instanceOfStorage(Jail::class)) {
/**
* @var Jail $sourceStorage
*/
$sourceInternalPath = $sourceStorage->getUnjailedPath($sourceInternalPath);
$sourceStorage = $sourceStorage->getUnjailedStorage();
}

$this->getCache()->moveFromCache($sourceStorage->getCache(), $sourceInternalPath, $targetInternalPath);
return true;
}
}

0 comments on commit 5c41417

Please sign in to comment.