diff options
Diffstat (limited to 'lib/private/files/cache/updater.php')
-rw-r--r-- | lib/private/files/cache/updater.php | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/lib/private/files/cache/updater.php b/lib/private/files/cache/updater.php index c5b1e7de32e..58d8e53cfd1 100644 --- a/lib/private/files/cache/updater.php +++ b/lib/private/files/cache/updater.php @@ -24,12 +24,14 @@ */ namespace OC\Files\Cache; +use OCP\Files\Cache\IUpdater; +use OCP\Files\Storage\IStorage; /** * Update the cache and propagate changes * */ -class Updater { +class Updater implements IUpdater { /** * @var bool */ @@ -145,18 +147,18 @@ class Updater { /** * Rename a file or folder in the cache and update the size, etag and mtime of the parent folders * - * @param \OC\Files\Storage\Storage $sourceStorage + * @param IStorage $sourceStorage * @param string $source * @param string $target */ - public function renameFromStorage(\OC\Files\Storage\Storage $sourceStorage, $source, $target) { + public function renameFromStorage(IStorage $sourceStorage, $source, $target) { if (!$this->enabled or Scanner::isPartialFile($source) or Scanner::isPartialFile($target)) { return; } $time = time(); - $sourceCache = $sourceStorage->getCache($source); + $sourceCache = $sourceStorage->getCache(); $sourceUpdater = $sourceStorage->getUpdater(); $sourcePropagator = $sourceStorage->getPropagator(); @@ -181,7 +183,9 @@ class Updater { $sourceCache->correctFolderSize($source); $this->cache->correctFolderSize($target); - $sourceUpdater->correctParentStorageMtime($source); + if ($sourceUpdater instanceof Updater) { + $sourceUpdater->correctParentStorageMtime($source); + } $this->correctParentStorageMtime($target); $this->updateStorageMTimeOnly($target); $sourcePropagator->propagateChange($source, $time); @@ -205,7 +209,7 @@ class Updater { * * @param string $internalPath */ - public function correctParentStorageMtime($internalPath) { + private function correctParentStorageMtime($internalPath) { $parentId = $this->cache->getParentId($internalPath); $parent = dirname($internalPath); if ($parentId != -1) { |