updating Cache to apply prefix for every key, closes #3821

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6323 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
gwoo 2008-01-05 03:24:25 +00:00
parent c47700d8c4
commit 3b7c80a65d
2 changed files with 5 additions and 5 deletions

View file

@ -225,7 +225,7 @@ class Cache extends Object {
if ($duration < 1) {
return false;
}
$success = $_this->_Engine[$engine]->write($key, $value, $duration);
$success = $_this->_Engine[$engine]->write($settings['prefix'] . $key, $value, $duration);
$_this->_Engine[$engine]->init($settings);
return $success;
}
@ -253,7 +253,7 @@ class Cache extends Object {
if (!$key = $_this->__key($key)) {
return false;
}
$success = $_this->_Engine[$engine]->read($key);
$success = $_this->_Engine[$engine]->read($settings['prefix'] . $key);
$_this->_Engine[$engine]->init($settings);
return $success;
}
@ -279,7 +279,7 @@ class Cache extends Object {
return false;
}
$success = $_this->_Engine[$engine]->delete($key);
$success = $_this->_Engine[$engine]->delete($settings['prefix'] . $key);
$_this->_Engine[$engine]->init($settings);
return $success;
}

View file

@ -215,7 +215,7 @@ class FileEngine extends CacheEngine {
$threshold = $now - $this->settings['duration'];
}
while (($entry = $dir->read()) !== false) {
if($this->__setKey(str_replace($this->settings['prefix'], '', $entry)) === false) {
if($this->__setKey($entry) === false) {
continue;
}
if ($check) {
@ -246,7 +246,7 @@ class FileEngine extends CacheEngine {
*/
function __setKey($key) {
$this->__File->Folder->cd($this->settings['path']);
$this->__File->name = $this->settings['prefix'] . $key;
$this->__File->name = $key;
if (!$this->__File->Folder->inPath($this->__File->pwd(), true)) {
return false;
}