Skip to content

Commit

Permalink
Reducing key length when using groups in WincacheEngine
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo committed Mar 27, 2012
1 parent afba5aa commit 2bb3dc6
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions lib/Cake/Cache/Engine/WincacheEngine.php
Expand Up @@ -150,15 +150,13 @@ public function clear($check) {
* @return array
**/
public function groups() {
$groups = $this->_compiledGroupNames;
if (empty($groups)) {
if (empty($this->_compiledGroupNames)) {
foreach ($this->settings['groups'] as $group) {
$groups[] = $this->settings['prefix'] . $group;
$this->_compiledGroupNames[] = $this->settings['prefix'] . $group;
}
$this->_compiledGroupNames = $groups;
}
$groups = wincache_ucache_get($groups);

$groups = wincache_ucache_get($this->_compiledGroupNames);
if (count($groups) !== count($this->settings['groups'])) {
foreach ($this->_compiledGroupNames as $group) {
if (!isset($groups[$group])) {
Expand All @@ -170,8 +168,9 @@ public function groups() {
}

$result = array();
foreach ($groups as $group => $value) {
$result[] = $group . $value;
$groups = array_values($groups);
foreach ($this->settings['groups'] as $i => $group) {
$result[] = $group . $groups[$i];
}
return $result;
}
Expand Down

0 comments on commit 2bb3dc6

Please sign in to comment.