summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2016-02-10 14:23:04 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2016-02-10 14:23:04 +0100
commitc4d2f6bb25019ac2928ff123bc162d348cf1e941 (patch)
treea6e8e4a87c0f75f5923a493ba167657336a89faa
parent9e07fe289dc23ad1575bc0bfd3f1b55e3bcd98a5 (diff)
parent762636efcd9519eada0e39de5ab5fb048c9881ef (diff)
downloadnextcloud-server-c4d2f6bb25019ac2928ff123bc162d348cf1e941.tar.gz
nextcloud-server-c4d2f6bb25019ac2928ff123bc162d348cf1e941.zip
Merge pull request #22270 from owncloud/use-cache-directly
Use cache directly instead of QueryBuilder
-rw-r--r--apps/files_versions/lib/storage.php7
1 files changed, 2 insertions, 5 deletions
diff --git a/apps/files_versions/lib/storage.php b/apps/files_versions/lib/storage.php
index 0b121c344f9..d5e21959698 100644
--- a/apps/files_versions/lib/storage.php
+++ b/apps/files_versions/lib/storage.php
@@ -169,11 +169,8 @@ class Storage {
// Keep the "encrypted" value of the original file
$oldVersion = $files_view->getFileInfo($filename)->getEncryptedVersion();
- $qb = \OC::$server->getDatabaseConnection()->getQueryBuilder();
- $qb->update('filecache')
- ->set('encrypted', $qb->createNamedParameter($oldVersion))
- ->where($qb->expr()->eq('fileid', $qb->createNamedParameter($newFileInfo->getId())))
- ->execute();
+ $cache = $newFileInfo->getStorage()->getCache();
+ $cache->update($newFileInfo->getId(), ['encrypted' => $oldVersion, 'encryptedVersion' => $oldVersion]);
}
}