From 2d9d0aedf8e6cc57581d745827612c509ed09030 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Wed, 30 Dec 2015 14:28:53 +0100 Subject: [PATCH] Cache usermanager instance in view --- lib/private/files/view.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/private/files/view.php b/lib/private/files/view.php index fcea4828c4..045af5fe82 100644 --- a/lib/private/files/view.php +++ b/lib/private/files/view.php @@ -86,6 +86,8 @@ class View { private $updaterEnabled = true; + private $userManager; + /** * @param string $root * @throws \Exception If $root contains an invalid path @@ -101,6 +103,7 @@ class View { $this->fakeRoot = $root; $this->lockingProvider = \OC::$server->getLockingProvider(); $this->lockingEnabled = !($this->lockingProvider instanceof \OC\Lock\NoopLockingProvider); + $this->userManager = \OC::$server->getUserManager(); } public function getAbsolutePath($path = '/') { @@ -1196,7 +1199,7 @@ class View { * @return \OC\User\User */ private function getUserObjectForOwner($ownerId) { - $owner = \OC::$server->getUserManager()->get($ownerId); + $owner = $this->userManager->get($ownerId); if ($owner instanceof IUser) { return $owner; } else {