diff --git a/indefero/src/IDF/Conf.php b/indefero/src/IDF/Conf.php index 90ad871..dd30438 100644 --- a/indefero/src/IDF/Conf.php +++ b/indefero/src/IDF/Conf.php @@ -108,6 +108,7 @@ class IDF_Conf extends Pluf_Model $conf->vdesc = $value; $conf->create(); $this->initCache(); + $this->_project->invalidateConfCache(); } function getVal($key, $default='') diff --git a/indefero/src/IDF/Project.php b/indefero/src/IDF/Project.php index 0063a1e..863e2a2 100644 --- a/indefero/src/IDF/Project.php +++ b/indefero/src/IDF/Project.php @@ -161,6 +161,14 @@ class IDF_Project extends Pluf_Model ); } + public function invalidateConfCache() { + $cache = Pluf_Cache::factory(); + $keys = $this->getConf()->getKeys(); + foreach($keys as $key) { + $cache->set("confCache" . $this->id . $key, null); + } + } + /** * String representation of the abstract. @@ -670,7 +678,14 @@ GROUP BY uid"; return parent::__get($key); } catch (Exception $e) { - return $this->getConf()->getVal($key); + $cache = Pluf_Cache::factory(); + if (null === ($confCache = $cache->get("confCache" . $this->id . $key, null))) { + $confCache = $this->getConf()->getVal($key); + $cache->set("confCache" . $this->id . $key, $confCache); + return $confCache; + } else { + return $confCache; + } } } diff --git a/indefero/src/IDF/templates/idf/main-menu.html b/indefero/src/IDF/templates/idf/main-menu.html index 0771abf..5442572 100644 --- a/indefero/src/IDF/templates/idf/main-menu.html +++ b/indefero/src/IDF/templates/idf/main-menu.html @@ -10,14 +10,17 @@ {/if}{if $customForgePageEnabled}