validateCache() 공개 메소드

Validate the cache. Compares the cache timestamp with the current cache timestamp in the state backend. If the timestamps are different, some other request has modified the cache, so it should be invalidated.
public validateCache ( boolean $hb_only = false ) : boolean
$hb_only boolean If true, only validate the hb timestamps. @since 2.4.0
리턴 boolean
예제 #1
0
파일: Collections.php 프로젝트: horde/horde
 /**
  * Save the syncCache to storage.
  *
  * @param boolean $preserve_folders  If true, ensure the folder cache is not
  *                                   overwritten. @since 2.18.0
  * @todo Refactor this hack away. Requires a complete refactor of the cache.
  */
 public function save($preserve_folders = false)
 {
     // HOTFIX. Need to check the timestamp to see if we should reload the
     // folder cache before saving to ensure it isn't overwritten. See
     // Bug: 13273
     if ($preserve_folders && !$this->_cache->validateCache()) {
         $this->_logger->info(sprintf('[%s] Updating the foldercache before saving.', $this->_procid));
         $this->_cache->refreshFolderCache();
     }
     $this->_cache->save();
 }
예제 #2
0
파일: Base.php 프로젝트: horde/horde
 protected function _testValidateAfterUpdateTimestamp()
 {
     $cache = new Horde_ActiveSync_SyncCache(self::$state, 'dev123', 'mike', self::$logger->getLogger());
     $this->assertEquals(true, $cache->validateCache());
     $cache->updateTimestamp();
     $this->assertEquals(true, $cache->validateCache());
 }