Zend Framework

Zend_Cache_Backend_ZendServer_ShMem and Zend_Cache_Backend_ZendServer_Disk throws an exception in test()

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.8.4
  • Fix Version/s: 1.9.2
  • Component/s: Zend_Cache
  • Labels:
    None

Description

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:

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 (http://files.zend.com/help/Zend-Server/zenddatacache.html).
The If-Statement should be if ($tmp !== false).

Activity

Hide
Satoru Yoshida added a comment -

Solved in SVN r17671

Show
Satoru Yoshida added a comment - Solved in SVN r17671

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: