mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 17:16:18 +00:00
Reducing key size when using groups in ApcEngine
This commit is contained in:
parent
2100a64ffd
commit
27b90b0e47
1 changed files with 6 additions and 7 deletions
|
@ -143,15 +143,13 @@ class ApcEngine extends CacheEngine {
|
||||||
* @return array
|
* @return array
|
||||||
**/
|
**/
|
||||||
public function groups() {
|
public function groups() {
|
||||||
$groups = $this->_compiledGroupNames;
|
if (empty($this->_compiledGroupNames)) {
|
||||||
if (empty($groups)) {
|
|
||||||
foreach ($this->settings['groups'] as $group) {
|
foreach ($this->settings['groups'] as $group) {
|
||||||
$groups[] = $this->settings['prefix'] . $group;
|
$this->_compiledGroupNames[] = $this->settings['prefix'] . $group;
|
||||||
}
|
}
|
||||||
$this->_compiledGroupNames = $groups;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$groups = apc_fetch($groups);
|
$groups = apc_fetch($this->_compiledGroupNames);
|
||||||
if (count($groups) !== count($this->settings['groups'])) {
|
if (count($groups) !== count($this->settings['groups'])) {
|
||||||
foreach ($this->_compiledGroupNames as $group) {
|
foreach ($this->_compiledGroupNames as $group) {
|
||||||
if (!isset($groups[$group])) {
|
if (!isset($groups[$group])) {
|
||||||
|
@ -163,8 +161,9 @@ class ApcEngine extends CacheEngine {
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = array();
|
$result = array();
|
||||||
foreach ($groups as $group => $value) {
|
$groups = array_values($groups);
|
||||||
$result[] = $group . $value;
|
foreach ($this->settings['groups'] as $i => $group) {
|
||||||
|
$result[] = $group . $groups[$i];
|
||||||
}
|
}
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue