Пример #1
0
 /**
  * Clears all partial cache blocks.
  *
  * Can only be called once per request (there may be multiple SSViewer instances).
  *
  * @param bool $force Set this to true to force a re-flush. If left to false, flushing
  * may only be performed once a request.
  */
 public static function flush_cacheblock_cache($force = false)
 {
     if (!self::$cacheblock_cache_flushed || $force) {
         $cache = SS_Cache::factory('cacheblock');
         $backend = $cache->getBackend();
         if ($backend instanceof Zend_Cache_Backend_ExtendedInterface && ($capabilities = $backend->getCapabilities()) && $capabilities['tags']) {
             $cache->clean(Zend_Cache::CLEANING_MODE_MATCHING_TAG, $cache->getTags());
         } else {
             $cache->clean(Zend_Cache::CLEANING_MODE_ALL);
         }
         self::$cacheblock_cache_flushed = true;
     }
 }