From 34d7450d3c13342715e90ec21bceaa13e1baa876 Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Sun, 28 Dec 2014 11:28:50 -0500 Subject: Template helpers refactoring --- app/Model/Config.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'app/Model/Config.php') 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(); } -- cgit v1.2.3