Permalink
Browse files

Reducing key length when using groups in WincacheEngine

  • Loading branch information...
1 parent afba5aa commit 2bb3dc6bf7a506a220c1e42ef5ba245052dd42f8 @lorenzo lorenzo committed Mar 27, 2012
Showing with 6 additions and 7 deletions.
  1. +6 −7 lib/Cake/Cache/Engine/WincacheEngine.php
View
13 lib/Cake/Cache/Engine/WincacheEngine.php
@@ -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])) {
@@ -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;
}

0 comments on commit 2bb3dc6

Please sign in to comment.