mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +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
|
||||
**/
|
||||
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 = apc_fetch($groups);
|
||||
$groups = apc_fetch($this->_compiledGroupNames);
|
||||
if (count($groups) !== count($this->settings['groups'])) {
|
||||
foreach ($this->_compiledGroupNames as $group) {
|
||||
if (!isset($groups[$group])) {
|
||||
|
@ -163,8 +161,9 @@ class ApcEngine extends CacheEngine {
|
|||
}
|
||||
|
||||
$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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue