You are here

views_plugin_cache_rules.inc in Cache Actions 7

Same filename and directory in other branches
  1. 6.2 views_plugin_cache_rules.inc
  2. 6 views_plugin_cache_rules.inc

This file contains a cache that just implements the views cache plugin.

File

views_plugin_cache_rules.inc
View source
<?php

/**
 * @file
 * This file contains a cache that just implements the views cache plugin.
 */

/**
 * Plugin that caches views infinitely. This is not really
 * that useful unless you want rules to invalidate your cache.
 */
class views_plugin_cache_rules extends views_plugin_cache {
  function summary_title() {
    return t('Rules');
  }

  /**
   * Since rules will be triggering our cache invalidation,
   * the cache will never expire.
   * @param $type
   * @return always FALSE.
   */
  function cache_expire($type) {
    return FALSE;
  }

  /**
   * We override the default caching mechanism, since it nukes everything.
   * We are just going to flush the actual display.
   */
  function cache_flush() {
    cache_clear_all($this->view->name . ':' . $this->display->id, $this->table, TRUE);
  }

}

Classes

Namesort descending Description
views_plugin_cache_rules Plugin that caches views infinitely. This is not really that useful unless you want rules to invalidate your cache.