Zend Framework

Zend_Cache_Frontend_Class need to switch _makeId to public in order to delete the cache object

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.10.5
  • Fix Version/s: 1.10.7
  • Component/s: Zend_Cache
  • Labels:
    None

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()

Activity

Hide
Bill Bell added a comment -

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?

Show
Bill Bell added a comment - 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?
Hide
Marc Bennewitz (private) added a comment -

fixed in r22642 (trunk) & r22643 (1.10 branch)

Show
Marc Bennewitz (private) added a comment - fixed in r22642 (trunk) & r22643 (1.10 branch)
Hide
Ramon Henrique Ornelas added a comment - - edited

BC break, Does not have no opposition about applying it in mini release.

Case Break BC:

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:

private function _makeId($callback, array $args)
{
    return $this->makeId($callback, $args);
}

Greetings
Ramon

Show
Ramon Henrique Ornelas added a comment - - edited BC break, Does not have no opposition about applying it in mini release. Case Break BC:
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:
private function _makeId($callback, array $args)
{
    return $this->makeId($callback, $args);
}
Greetings Ramon
Hide
Marc Bennewitz (private) added a comment -

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

Show
Marc Bennewitz (private) added a comment - 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
Hide
Marc Bennewitz (private) added a comment -

fixed in r22654 (1.10 branch)

Show
Marc Bennewitz (private) added a comment - fixed in r22654 (1.10 branch)

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: