summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/private/AllConfig.php19
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/private/AllConfig.php b/lib/private/AllConfig.php
index 52d77bf3f52..af26d30d8e9 100644
--- a/lib/private/AllConfig.php
+++ b/lib/private/AllConfig.php
@@ -215,6 +215,25 @@ class AllConfig implements \OCP\IConfig {
// TODO - FIXME
$this->fixDIInit();
+ if (isset($this->userCache[$userId][$appName][$key])) {
+ if ($this->userCache[$userId][$appName][$key] === (string)$value) {
+ return;
+ } else if ($preCondition !== null && $this->userCache[$userId][$appName][$key] !== (string)$preCondition) {
+ return;
+ } else {
+ $qb = $this->connection->getQueryBuilder();
+ $qb->update('preferences')
+ ->set('configvalue', $qb->createNamedParameter($value))
+ ->where($qb->expr()->eq('userid', $qb->createNamedParameter($userId)))
+ ->andWhere($qb->expr()->eq('appid', $qb->createNamedParameter($appName)))
+ ->andWhere($qb->expr()->eq('configkey', $qb->createNamedParameter($key)));
+ $qb->execute();
+
+ $this->userCache[$userId][$appName][$key] = $value;
+ return;
+ }
+ }
+
$preconditionArray = [];
if (isset($preCondition)) {
$preconditionArray = [