public function testCleanModeMatchingAnyTags4()
 {
     $this->_instance->clean(Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG, array('tag1', 'tag4'));
     $this->assertFalse(!!$this->_instance->load('bar'));
     $this->assertFalse(!!$this->_instance->load('bar2'));
     $this->assertTrue(!!$this->_instance->load('bar3'));
 }
Exemplo n.º 2
0
 /**
  * This method will dispatch the event 'magehost_cache_miss_mh' when a cache key miss occurs loading a key
  * from MageHost_BlockCache.
  * This method will return false when constructor failed.
  *
  * This method will also catch exceptions on Redis failure.
  *
  * {@inheritdoc}
  */
 public function load($id, $doNotTestCacheValidity = false)
 {
     $result = false;
     if ($this->works) {
         try {
             $result = parent::load($id, $doNotTestCacheValidity);
         } catch (CredisException $e) {
             $this->processRedisException($e, 'load');
             $result = false;
         } catch (RedisException $e) {
             $this->processRedisException($e, 'load');
             $result = false;
         } catch (Zend_Cache_Exception $e) {
             $this->processRedisException($e, 'load');
             $result = false;
         }
     }
     if (false === $result && false !== strpos($id, '_JV_')) {
         Mage::dispatchEvent('jv_cache_miss_jv', array('id' => $id));
         // deprecated
         Mage::dispatchEvent('magehost_cache_miss_jv', array('id' => $id));
     }
     if (false === $result && false !== strpos($id, '_MH_')) {
         Mage::dispatchEvent('magehost_cache_miss_mh', array('id' => $id));
     }
     return $result;
 }