Skip to main content
Sign in
Snippets Groups Projects
Unverified Commit 0893a62a authored by Roeland Jago Douma's avatar Roeland Jago Douma
Browse files

Be lazy when fetching UserFolder


Since on a lot of requests the routes are loaded (and thus the
application is initialized) it is good to not be greedy. Now we only
fetch the user folder when one of the controllers is actually called.

Signed-off-by: default avatarRoeland Jago Douma <roeland@famdouma.nl>
parent eb298be5
Branches
Tags
No related merge requests found
......@@ -39,9 +39,11 @@ class Application extends App {
return $c->getServer()->getSession();
});
$user = $container->query("UserId");
$container->registerParameter("appName", "mail");
$container->registerParameter("userFolder", $container->getServer()->getUserFolder($user));
$container->registerService("userFolder", function ($c) use ($container) {
$user = $container->query("UserId");
return $container->getServer()->getUserFolder($user);
});
$container->registerParameter("testSmtp", $testSmtp);
$container->registerParameter("referrer", isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : null);
$container->registerParameter("hostname", Util::getServerHostName());
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment