Zend Framework

Zend_Cache_Core::getIdsMatchingTags

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.9.1
  • Fix Version/s: 1.10.3
  • Component/s: Zend_Cache
  • Labels:
    None

Description

when I call getIds() on my Cache Object I get the right ids but when I call getIdsMatchingTags , it gives me the ids prefixed by the 'namespace' I have to strip it manually because load() on those ids do not load the right cache data.

Activity

Hide
Michael Bagur added a comment -

I think I found the problem. in getIds() you have :

replacing

return $this->_backend->getIdsMatchingTags($tags);

line 448

by

$array = $this->_backend->getIdsMatchingTags($tags);
if ((!isset($this->_options['cache_id_prefix'])) || ($this->_options['cache_id_prefix'] == '')) return $array;
// we need to remove cache_id_prefix from ids (see #ZF-6178)
$res = array();
while (list(,$id) = each($array)) {
if (strpos($id, $this->_options['cache_id_prefix']) === 0) {
$res[] = preg_replace("~^{$this->_options['cache_id_prefix']}~", '', $id);
} else { $res[] = $id; }
}
return $res;

should work (see see #ZF-6178)

and same thing goes with getIdsNotMatchingTags

Show
Michael Bagur added a comment - I think I found the problem. in getIds() you have : replacing return $this->_backend->getIdsMatchingTags($tags); line 448 by $array = $this->_backend->getIdsMatchingTags($tags); if ((!isset($this->_options['cache_id_prefix'])) || ($this->_options['cache_id_prefix'] == '')) return $array; // we need to remove cache_id_prefix from ids (see #ZF-6178) $res = array(); while (list(,$id) = each($array)) { if (strpos($id, $this->_options['cache_id_prefix']) === 0) { $res[] = preg_replace("~^{$this->_options['cache_id_prefix']}~", '', $id); } else { $res[] = $id; } } return $res; should work (see see #ZF-6178) and same thing goes with getIdsNotMatchingTags
Hide
Marc Bennewitz (private) added a comment -

fixed in r21280 (trunk) and r21293 (1.10 branch)

Show
Marc Bennewitz (private) added a comment - fixed in r21280 (trunk) and r21293 (1.10 branch)

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: