Issues

ZF-9970: Zend_Cache_Frontend_Class need to switch _makeId to public in order to delete the cache object

Issue Type: Improvement Created: 2010-06-09T13:57:59.000+0000 Last Updated: 2012-03-13T22:16:42.000+0000 Status: Closed Fix version(s): - 1.10.7 (28/Jul/10)

Reporter: Bill Bell (billnbell) Assignee: Marc Bennewitz (private) (mabe) Tags: - Zend_Cache

Related issues: - ZF-12099

Attachments:

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:

<pre class="highlight">
class ExtendFunction extends Zend_Cache_Frontend_(Function|Class)
{
    private function _makeId($callback, array $args)
    {
        // my implementation
    }
}

Keep the method private e makes called to method public. Correct also the called in the Zend_Cache_Frontend_(Function|Class):>call().

Sample code:

<pre class="highlight">
private function _makeId($callback, array $args)
{
    return $this->makeId($callback, $args);
}

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)

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts