Skip to content
Snippets Groups Projects

hotline #142649 upgrade cache key

Merged Ghislain Loas requested to merge hotline#142649 into master
Compare and
2 files
+ 11
5
Preferences
Compare changes
Files
2
+ 9
2
@@ -82,17 +82,18 @@ class Storm_Cache {
}
public function setEnabled($enabled) {
$this->_enabled = $enabled;
return $this;
}
public function setCache($zend_cache) {
$this->_zend_cache = $zend_cache;
return $this;
}
public function memoize($key, $callback) {
if(!$this->_enabled)
return $callback();
@@ -105,6 +106,7 @@ class Storm_Cache {
return $data;
}
public function getCache() {
if(!isset($this->_zend_cache))
$this->_zend_cache = static::getDefaultZendCache();
@@ -143,7 +145,7 @@ class Storm_Cache {
public function addSeedToKey($key) {
return md5(json_encode([$this->_getRealSeed(), $key]));
return $this->_getRealSeed() . '_' . md5(json_encode([$key]));
}
@@ -166,6 +168,11 @@ class Storm_Cache {
}
public function getRealSeed() {
return $this->_getRealSeed();
}
public function clean(){
static::$_real_seed = $this->_generateRealSeed();
return $this;