Skip to content
Snippets Groups Projects
Commit 42897ac5 authored by Thomas Müller's avatar Thomas Müller
Browse files

Merge pull request #21402 from owncloud/view-getuserobject-cache

Cache usermanager instance in view
parents 45c41e2b 2d9d0aed
No related branches found
No related tags found
No related merge requests found
...@@ -86,6 +86,8 @@ class View { ...@@ -86,6 +86,8 @@ class View {
private $updaterEnabled = true; private $updaterEnabled = true;
private $userManager;
/** /**
* @param string $root * @param string $root
* @throws \Exception If $root contains an invalid path * @throws \Exception If $root contains an invalid path
...@@ -101,6 +103,7 @@ class View { ...@@ -101,6 +103,7 @@ class View {
$this->fakeRoot = $root; $this->fakeRoot = $root;
$this->lockingProvider = \OC::$server->getLockingProvider(); $this->lockingProvider = \OC::$server->getLockingProvider();
$this->lockingEnabled = !($this->lockingProvider instanceof \OC\Lock\NoopLockingProvider); $this->lockingEnabled = !($this->lockingProvider instanceof \OC\Lock\NoopLockingProvider);
$this->userManager = \OC::$server->getUserManager();
} }
public function getAbsolutePath($path = '/') { public function getAbsolutePath($path = '/') {
...@@ -1196,7 +1199,7 @@ class View { ...@@ -1196,7 +1199,7 @@ class View {
* @return \OC\User\User * @return \OC\User\User
*/ */
private function getUserObjectForOwner($ownerId) { private function getUserObjectForOwner($ownerId) {
$owner = \OC::$server->getUserManager()->get($ownerId); $owner = $this->userManager->get($ownerId);
if ($owner instanceof IUser) { if ($owner instanceof IUser) {
return $owner; return $owner;
} else { } else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment