ZF-7691: Zend_Cache clean() does not work

Issue Type: Bug Created: 2009-08-26T02:54:00.000+0000 Last Updated: 2009-08-28T02:46:44.000+0000 Status: Resolved Fix version(s): - 1.9.3 (22/Sep/09)

Reporter: Eduard Zintz (ezintz) Assignee: Satoru Yoshida (satoruyoshida) Tags: - Zend_Cache

Related issues: Attachments:


I'm trying to remove a cache with a specific tag. the clean()-method returns true, but the cache file gets not deleted or cleared.

How I save the cache: Someone is looking at a database record over a controller, i'm generating a individualy cache-id with some params. I start a new cache block and call it with $cache->end(array('tag', 'tag2'); When I'm going to save the existing database record i want to delete the cache. So I build up a new instance of the cache object in my model, and search for matching cache-ids.

my code looks like this:

<pre class="highlight">
$cacheIds = $cache->getIdsMatchingTags(array($this->getId()));
foreach ($cacheIds as $cacheId) {

I don't know what to do else? I think that is a problem with Zend_Cache, r/w permissions are set cause i can write the cache on the given path.


Posted by Satoru Yoshida (satoruyoshida) on 2009-08-26T03:57:57.000+0000

Can you specify your Backend type and options? i.e. Xcache, Memcache , File etc.

Posted by Eduard Zintz (ezintz) on 2009-08-26T04:23:06.000+0000


$config = Zend_Registry::get('config')->cache; $cache = Zend_Cache::factory( $config->frontend, $config->backend, $config->frontendOptions->toArray(), $config->backendOptions->toArray());

Posted by Satoru Yoshida (satoruyoshida) on 2009-08-27T07:22:28.000+0000

I think this issue may be similar to ZF-5740.

I suggest the following code:

<pre class="highlight">
$result = ($result) && $this->remove($id);

should be:

<pre class="highlight">
$res = $this->remove($id);
$result = $result && $res;


<pre class="highlight">
$result = $this->remove($id) && $result;

Posted by Satoru Yoshida (satoruyoshida) on 2009-08-28T02:46:42.000+0000

Solved in SVN r17867

Have you found an issue?

See the Overview section for more details.


© 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.