ZF-9970: Zend_Cache_Frontend_Class need to switch _makeId to public in order to delete the cache object
Description
New code: public function _makeId($name, $parameters) { return md5($this->_cachedEntityLabel . '' . $name . '' . serialize($parameters)); }
We can then invalidate with:
$cache = Zend_Cache::factory('Class','Memcached', $frontendOptions, $backendOptions); $cache->remove($cache->_makeId($method, $parms));
For database:
$query_cache = Zend_Cache::factory('Core','Memcached', $frontendOptions, $backendOptions); $query_cache->remove($name); // note: this does not need _makeId()
Comments
Posted by Bill Bell (billnbell) on 2010-07-14T16:15:54.000+0000
Can someone please change _makeId to public? or add a wrapper so we can get at the md5 value so we can invalidate for memcache?
Posted by Marc Bennewitz (private) (mabe) on 2010-07-20T00:31:50.000+0000
fixed in r22642 (trunk) & r22643 (1.10 branch)
Posted by Ramon Henrique Ornelas (ramon) on 2010-07-20T07:08:28.000+0000
BC break, Does not have no opposition about applying it in mini release.
Case Break BC:
Keep the method private e makes called to method public. Correct also the called in the Zend_Cache_Frontend_(Function|Class):>call().
Sample code:
Greetings Ramon
Posted by Marc Bennewitz (private) (mabe) on 2010-07-20T07:48:38.000+0000
Hi Ramon - thanks for your comment.
I changed it in r22648 & r22649 (trunk) - If it's ok I merge it to the 1.10 branch. -> Additionally I changed the public method "makeId" to the following structure: "public function makeId($callback, array $args = array())"
Greetings
Posted by Marc Bennewitz (private) (mabe) on 2010-07-22T11:44:44.000+0000
fixed in r22654 (1.10 branch)