summaryrefslogtreecommitdiff
path: root/app/Model/Config.php
diff options
context:
space:
mode:
authorFrédéric Guillot <fred@kanboard.net>2014-12-28 11:28:50 -0500
committerFrédéric Guillot <fred@kanboard.net>2014-12-28 11:28:50 -0500
commit34d7450d3c13342715e90ec21bceaa13e1baa876 (patch)
treea2d8f2f22ad3fe9b56f01fe2db0357f9b963e660 /app/Model/Config.php
parent88d84073aecbe8bdc5f10825b6d7ca6b81c5f7b1 (diff)
Template helpers refactoring
Diffstat (limited to 'app/Model/Config.php')
-rw-r--r--app/Model/Config.php11
1 files changed, 6 insertions, 5 deletions
diff --git a/app/Model/Config.php b/app/Model/Config.php
index 16e9bf45..54d9d7cd 100644
--- a/app/Model/Config.php
+++ b/app/Model/Config.php
@@ -76,12 +76,13 @@ class Config extends Base
return $value ?: $default_value;
}
- if (! isset($_SESSION['config'][$name])) {
- $_SESSION['config'] = $this->getAll();
+ // Cache config in session
+ if (! isset($this->session['config'][$name])) {
+ $this->session['config'] = $this->getAll();
}
- if (! empty($_SESSION['config'][$name])) {
- return $_SESSION['config'][$name];
+ if (isset($this->session['config'][$name])) {
+ return $this->session['config'][$name];
}
return $default_value;
@@ -126,7 +127,7 @@ class Config extends Base
*/
public function reload()
{
- $_SESSION['config'] = $this->getAll();
+ $this->session['config'] = $this->getAll();
$this->setupTranslations();
}