ZF-7358: Zend_Cache_Backend_ZendServer_ShMem and Zend_Cache_Backend_ZendServer_Disk throws an exception in test()

Issue Type: Bug Created: 2009-07-23T02:50:50.000+0000 Last Updated: 2009-08-19T06:06:01.000+0000 Status: Resolved Fix version(s): - 1.9.2 (25/Aug/09)

Reporter: Oliver Tischlinger (zoerznu) Assignee: Satoru Yoshida (satoruyoshida) Tags: - Zend_Cache

Related issues: Attachments:


Using Zend_Cache_Backend_ZendServer_ShMem or Zend_Cache_Backend_ZendServer_Disk as back end throws an exception when testing if id is already in the cache.

Here is the test method:

<pre class="highlight">
    public function test($id)
        $tmp = $this->_fetch('internal-metadatas---' . $id);
        if ($tmp !== null) {
                if (!is_array($tmp) || !isset($tmp['mtime'])) {
                        Zend_Cache::throwException('Cache metadata for \'' . 
$id .
'\' id is corrupted' );
            return $tmp['mtime'];
        return false;

The problem is in that first if. _fetch() calls zend_shm_cache_fetch() and zend_disk_cache_fetch respectively which will return false if the item is not found (…). The If-Statement should be if ($tmp !== false).


Posted by Satoru Yoshida (satoruyoshida) on 2009-08-19T06:05:56.000+0000

Solved in SVN r17671

Have you found an issue?

See the Overview section for more details.


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

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